Skip to content

Instantly share code, notes, and snippets.

@fczuardi
Created September 22, 2011 03:30
Show Gist options
  • Select an option

  • Save fczuardi/1233955 to your computer and use it in GitHub Desktop.

Select an option

Save fczuardi/1233955 to your computer and use it in GitHub Desktop.
Jquery queue example
var filas = $({});
function queueExample(){
filas.queue('fila1', function(){console.log('1 foo');});
filas.queue('fila1', function(){console.log('1 bar');});
filas.queue('fila2', function(){console.log('2 FOO');});
filas.queue('fila2', function(){console.log('2 BAR');});
filas.queue('fila2', function(){console.log('foobar');});
console.log(filas.dequeue('fila1')); //1 foo
console.log(filas.dequeue('fila2')); //2 FOO
console.log(filas.dequeue('fila2')); //2 BAR
console.log(filas.dequeue('fila1')); //1 bar
console.log(filas.dequeue('fila2')); //foobar
}
queueExample();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment