dianikol85 Posted December 11, 2010 Report Posted December 11, 2010 (edited) 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 December 11, 2010 by dianikol85 Quote
falkencreative Posted December 12, 2010 Report Posted December 12, 2010 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. Quote
dianikol85 Posted December 12, 2010 Author Report Posted December 12, 2010 i see.Although it doesn't look very steady to me especially with the hover move... Quote
BeeDev Posted December 15, 2010 Report Posted December 15, 2010 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. Quote
Recommended Posts
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.