jQuery queue & dequeue

 

These methods tend to come in pairs when you’re working within the animation queue.

When you use the animate and showhideslideUp, etc effect methods, you’re adding a job on to the fx queue.

By default, using queue and passing a function, will add to the fx queue. So we’re creating our own bespoke animation

 

step:

 

 

 

 

As I said though, these methods come in pairs, so anything you add using queue, you need to dequeue to allow the process to continue. In the code above, if I chained more animations on, until I call $(this).dequeue(), the subsequent animations wouldn’t run:

 

 

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章