May 13, 2010

jQuery queue and deque

You queue a serial of function, then run the function in a serial.

   var area = document.getElementById("area");

         $.queue(area, "test", function (fn) { alert("hello"); fn()});

         $("#test").click(function () {
             var data = $.dequeue(area, "test");
             data();
         });