Community Page
- paulmwatson.com/journal Jump to website »
-
Subscribe -
Community
-
Top Commenters
-
Popular Threads
-
Recent Comments
- Make songbird look like spotify: http://addons.songbirdnest.com/addon/1440
- Got it, thanks Paul!
- Email me your email address so I can invite you Mike (paul@paulmwatson.com)
- Happy New Year to you, as well! I was stopping by to see if you would be willing to lend a reader a Spotify invitation. I am desperately hoping to be able try out the service. Thanks! Mike
- Nice one Jamie. Even more ironic is that that "mass production" is probably still underpaid, underage workers in some 3rd world country sweat-shop.
Jump to original thread »
Anybody know of a JavaScript function queue? The more I get into developing Ajax apps the more I need to reliably queue function calls. e.g. script.aculo.us needs to highlight an element then do a DropOut on it and then I want some JavaScript to remove the element from the DOM. You can’%3
... Continue reading »
3 years ago
3 years ago
3 years ago
function fQueue()
{
var pos = 0;
var queue = arguments;
return function()
{
if ( pos < queue.length )
queue[pos++]();
}
}
function DoThingOne(whenDone)
{
document.getElementById("Output").innerHTML += "Thing One!<br>";
whenDone();
}
function DoThingTwo(whenDone)
{
document.getElementById("Output").innerHTML += "Thing Two!<br>";
whenDone();
}
function DoThingThree(whenDone)
{
document.getElementById("Output").innerHTML += "Thing Three!<br>";
whenDone();
}
function DoThings()
{
var q = fQueue(
function(){DoThingOne(q);},
function(){DoThingTwo(q);},
function(){DoThingThree(q);});
q();
}
...no idea if that's close to what you're looking for, but if it is and you get rich, send me a pizza.
A *solid gold* pizza.
With pepperoni and mushrooms.
*Morel* mushrooms.
-josh
3 years ago
see: http://www.railsdevelopment.com/2006/01/15/effe...
Then use the afterFinish option for executing arbitrary code when the effect is done.
3 years ago
2 years ago
http://www.safalra.com/programming/javascript/q...
2 years ago
var queue = new Array()
//Enqueue
queue.push(obj);
//Dequeue
obj = queue.shift()