Newbie question: how to play my animation in reverse upon second click
Hey ya'll,
I'm slowly learning jQuery and starting to have some fun with it. I've set up an animation where if you click a certain anchor the animation plays. However, being new at this, I cannot figure out how to play the animation in reverse if the same anchor is clicked a second time.
Here is an example of my sloppy script:
<script>
$("#animate").click(function(){
$(".box1, .box2, .box3, .box4").animate({
height: "98px",
opacity: 1,
marginTop: "109px",
border: "1px solid #666",
}, 200 );
});
</script>
That is all I have so far. Any ideas? An IF statement perhaps?
Thanks!
-B