Do jquery processing with a little breathing room
Have you ever done something like...
$("td").someBigNastyPlugin();
...and it was just too much processing for your browser? (I'm looking at you, IE)
It would be nice if your browser had a little bit of time to catch its breath while it's trying to do all that processing.
jQuery.gasp to the rescue!
Include my gasp plug-in, and replace that code above with the following, and you'll have a happy browser.
$("td").gasp(function(){ $(this).someBigNastyPlugin(); });
Essentially, it's like jquery's .each function, but it puts a setTimeout around each one, and chains them together, one after the other. If you saw my whereas plug-in, this will make more sense.
Now this is asyncronous, but it returns a promise, so you have to treat it accordingly:
$("td").gasp(function(){ $(this).someBigNastyPlugin(); }) .done(function(){ console.log("This will run when it's complete"); }); console.log("This will run before the gasping is finished");
The code includes the jquery.whereas code. Just seemed easier (for you) that way.