Callback execution only on last in stack
<p>Currently I've set it up like this,</p>

<pre><code>var elements = $('#one, $two, #three, #four, #six');

var _temp = 0;
elements.hide(0, function(){
    /* by default, the callback will be performed to
       every single element in stack */

    _temp++; // increment temporary cache

    // perform actual callback only on last in list
    if (_temp == elements.length) {
        // do stuff
    }
});
</code></pre>

<p>but it feels wrong, because if I'd want to do the same for another callback 241 lines below, I'd have to reset <code>_temp</code> and well, global variables are just messy.</p>

<p>How could I simplify this?</p>
