jquery - happy clicker - looking for callback on bound event
<p>I'm binding some slightly complex functionality to a click event</p>

<pre><code>$(someSelector)).bind('click', someFunction(a,b,c));

function somefunction(a,b,c) {
    return function() {
        // some logic
        $(anotherSelector).each(function() {
            // fade out with call back...
            $(this).fadeOut("fast", function() {
                // TODO: add callback here???
                $(contentSelector).fadeIn("fast");
            })
        })

    }
}
</code></pre>

<p>The problem is that a series of fast clicks results in inconsistent fadeOut / fadeIn behaviour. I'm assuming that new click events are processed before the current fadeIn is complete. </p>

<p>I think I'm looking for some callback mechanism that ensures that new clicks are processed after current clicks are finished. I could add a callback to fadeIn, but I don't see what I kind of logic would help me there...</p>

<p>I also read about unbinding components for as long as a click is processed (and later rebinding them), but again - I'm not sure on top of which logic I would put that.</p>

<p>Thanks for advice :)</p>
