Jump to content
Killersites Forums

A jquery question.


Recommended Posts

Hi to all. A quick question about jquery. I noticed that with the animation effect many devs uses this statement : {queue:false} for example: $('#something').animate({something},{queue:false}); Is that something important??? I never had issues not using it. What's the big deal?

 

 

Thank you

Edited by dianikol85
Link to post
Share on other sites

From: http://api.jquery.com/animate/

 

"queue: A Boolean indicating whether to place the animation in the effects queue. If false, the animation will begin immediately."

 

For example, say you are building out a dropdown menu, where hovering over one of the main menu items will cause a dropdown menu to slide in. It is possible that by hovering over the nav item, moving your mouse quickly off and then back on the item several times would cause an animation queue -- basically, the animation would slide in, out in again -- as many times as you moved the mouse over it. Setting queue to false -- as far as I understand it based on the documentation -- would not allow a queue of animations to build up, but any previous animations would be canceled and the latest one started.

Link to post
Share on other sites
but any previous animations would be canceled and the latest one started.

 

Think it automatically skips the animation, and puts the element into the state it's supposed to be in, instead of cancelling the animation halfway. But yea, what Ben said is pretty much the case for animation queue. It's quite standard these days, as it's not very practical for the menu to be animating itself even after the mouse has stopped moving.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...