Jquery Stop Function

Jquery Stop Function

When you run a jquery function, generally, if you have it click on a button or link, and than do an animation, it runs the last command of the animation over and over again, after the initial function has been run all the way through once. I have tried to stop this by using the break; method, but soon found that wasn't supported, so I went ahead and used the return false; method, and still, it continues to run the last command. What I am trying to accomplish is when you click a button, it performs an animation, and ends. Than, when you click the SAME button again, at anytime during the same session on the page, it will undo itself. Basically, I need to know how to perform 2 functions, depending on the click, sort of like a toggle for an animation, with ONE button. Here is what I have so far: // JavaScript Document

$(document).ready(function(){
var toggle= "";
$("#home").click(function(){
$("#pusher").animate({height:"250px"},0);
$("#drop-block").fadeTo(0,1);
$("#drop-block").animate({"left": "+=10%"},3000);
$("#drop-block").animate({height:"500px"},"fast");
$("#drop-block").animate({width:"90%"},"800");
$("#content").delay(5000).fadeTo(1000,1);
toggle = "true";
return false;
});
if (toggle=="true") {
$("#home").click(function(){
$("drop-block").animate({width:"0"})
});
}
});


Its not complete, but its what I thought it might look like in peices