I’m making a simple animation in jQuery, when you hover an a, the p element slides into place underneath it (position: absolute;) but when you hover the a, the p jumps to a position then animates, it’s so weird!
$(".wrap a").hover(function() {
$(".wrap p").animate({left: '0'},{duration:500});
}, function(){
$(".wrap p").animate({left: '100%'}, {duration:500});
});
;
Any ideas why this might happen?
You passed
0instead of0%, it will confuse jQuery in some browsers wheregetComputedStyle(what jQuery uses) behaviour differs in units.http://jsfiddle.net/BAXc2/3/