I hide a few elements like this:
$('#item1,#item2,#item3').hide('slow',function() { console.log('hidden'); });
The problem is that these magazines are four times. For reasons beyond my control, I cannot use a common class for each element. Is there a good jquery-ish way to make this handler only fire after the last element is hidden? (or first, since they should be almost simultaneous)
In addition, the elements will be hidden and shown many times, so everything that is used to limit the invocation of the handler must be reset subsequently.
I can obviously put some kind of boolean in the handler, but I was hoping for a cleaner solution.
source share