aredottecluro
New Member
I have an area of content that I want to animate, however the animation only works the first time that I click on the trigger. On the second click of the trigger, the animation reverses. Here is my code.The HTML\[code\]<div class="drawer-content" id="signin"> </div><!--End #signin-->\[/code\]The jQuery\[code\]$(document).ready(function() { //We hide the panel $('.drawer-content').css('marginTop', '-140px' ); //When the anchor is clicked the panel will slide up $('.open-drawer').click(function(){ $('.drawer-content').animate({marginTop: '0px',}, 1000 ); //Append active class to anchor $(this).removeClass('open-drawer').addClass('active'); //On click the active link will cause the panel to slide down $('.active').click(function() { $(this).removeClass('active').addClass('open-drawer'); $('.drawer-content').animate({marginTop: '-140px',}, 1000 ); }); });});//End DOM Load\[/code\]EditHere is a live example for those who asked. Thanks!http://livecoding.io/3854307The comments should make this pretty self-explanatory. It works the first time, but if I try to run the animation again, the box just slides down and then slides right back up again. What am I doing wrong?