How can I wait a while and then change variable?
<p>I have a little code using jquery and I want to wait like, 300ms and then change a variable. I tried setTimeout but it wouldn't work, it just made the variable change instantly.</p>

<pre><code>setTimeout(animationWait = 0, 300);
</code></pre>

<p>(I defined animationWait earlier globally in the document) Basically what I'm trying to do is wait for a click to end before another click can be done. So i thought I'd set a variable and then wait 300ms, </p>

<pre><code>$('#up-arrow').live('click', function(e) {  

    if(animationWait == 0) {
        animationWait = 1;
        .... /* Code */
    }
}
</code></pre>

<p>So I need to change the animationWait back to 0 again after a delay to run the code. I've tried a bunch of stuff but it's still not working, any ideas?</p>
