jquery - Slide Div In and Out at the same time -
i trying create effect such when link clicked div on page slides out left, , linked div slides in left : http://templates.entheosweb.com/template_number/live_demo.asp?templateid=38272
can please me on this?
as @seamirra said, try use callback function of .animate(). check fiddle: http://jsfiddle.net/ykbgt/5677/
$('.button a').click(function(e) { e.preventdefault(); var tg = $(this).attr('href'); tg = tg.substr(1, tg.length); /* target id */ $('.current').animate({'left' : '-50%'}, 500, function(){ $('.current').removeclass('current'); $('#' + tg).addclass('current').animate({'left' : '50%'}, 500); }); });
Comments
Post a Comment