Fixed a bug that Overlapping label is still showed even if the related control has text contents

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@8850 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
taggon 2011-08-24 02:50:57 +00:00
parent 85f921f9e9
commit 3cd09ec9ed

View file

@ -5,11 +5,12 @@ jQuery(function($){
// Overlapping label
$('.form li').find('>input:text,>input:password,>textarea')
.filter('input[value!=""],textarea:not(:empty)').prev('label').css('visibility','hidden').end().end()
.prev('label')
.css({position:'absolute',top:'15px',left:'5px'})
.next()
.focus(function(){
var $label = $(this).prev().stop().animate({opacity:0, left:'25px'},'fast',function(){ $label.css('visibility','hide') });
var $label = $(this).prev().stop().animate({opacity:0, left:'25px'},'fast',function(){ $label.css('visibility','hidden') });
})
.blur(function(){
var $this = $(this), $label;
@ -17,9 +18,6 @@ jQuery(function($){
$label = $this.prev().stop().css('visibility','visible').animate({opacity:1, left:'5px'},'fast');
}
})
.filter('[value!=""]')
.prev().css('visibility','hide').end()
.end()
.end()
.parent()
.css('position', 'relative');