there's a toggle() method, too, that toggles between two functions. like this:
$("#container").toggle(function() { $("#container").animate({"marginTop": "-300px"}, "slow"); }, function() { $("#container").animate({"marginTop": "300px"}, "slow"); }); :)