2 questions of .dequeue

2 questions of .dequeue

What is difference between dequeue is set after queue and in queue. I can't find any amply description. I found first variant in example of custom animation.



Author wrote.


Nothing happens. Why? Because unlike the default fx queue, custom queues are not dequeued immediately. They require an explicit dequeue call to get them started.



And then he offers example with dequeue after queue.



  1. <!DOCTYPE html>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
            <style>
                div {
                    margin: 3px;
                    width: 40px;
                    height: 40px;
                    position: absolute;
                    left: 0px;
                    top: 60px;
                    background: green;
                }
            </style>
            <script type="text/javascript" src="js/jquery-1.8.0.min.js"></script>
        </head>
        <body>
            <div id="object"></div>
            <script>
                $("#object").queue("custom", function(next){
                    alert("I was queued!");
                    next();
                }).dequeue("custom");
            </script>
        </body>
    </html>

























          



If I set dequeue to $(this) inside the queue, then it doesn't work.

Because unlike the default fx queue, custom queues are not dequeued immediately.
Hm.. If you try to clear dequeue method in some jquery example with fx queue, you got that the next effects will not work. So how the fx queues are dequeued immediately? What did he mean? Is there two kind of dequeue and i knew only before this article?




Here is full article http://cdmckay.org/blog/2010/06/22/how-to-use-custom-jquery-animation-queues/