jquery - Javascript animation with -
i'm attempting items animate 1 location new 1 on click of appropriate button. though used fixed positions , have javascript set location before animation, things still go off page before end point.
firefox , webkit browsers have had different errors on , off , can't find solid solution this, me out this?
$(function(){ $("#nav li").click(function() { $("#nav").css({ 'left' : $(this).position().left + 'px', 'top' : $(this).position().top + 'px' }) .animate({ 'margin-top' : '-175px', 'margin-left' : '0px', 'left' : '10px', 'top' : '50%', 'height' : '370px', 'width' : '70px' }, 500, 'swing'); $("#name").css({ 'top': $(this).position().top + 'px' }) .animate({ 'top' : '100px' } , 500, 'swing'); }); $("#buttona").click(function() { $("#a").animate({ 'opacity' : '1' , 'top' : '50%', 'margin-top' : '-200px' }, 500, 'swing'); }); });
your use of #nav li#a
, .set#a
worries me. ids must unique, never makes sense use more id in selector. cause of animation issues.
Comments
Post a Comment