Ok sorry about the title, don't know what to say. I have a site for a client, and when you click a certain div it animates with a marginTop -=300px like effect so the div is just visible sliding in behind another div.
Now, if the user clicks the div again it will do the same and go up by 300px. What I want is a toggle like function where if you click it the second time it now adds the 300px back and the div is back in place. so right now here is the setup code, very simple: $("#container").click(function() { $ ("#container").animate({"marginTop": "-=237px"}, "slow"); }); There has to be an easier way then to set a cookie stating "Clicked=yes" then reset to "No" Anyone? Thanks