Animate animation locked in queue how to fix

Source: Internet
Author: User

[Example]:

function scroll_to (obj) {
$ (' html,body '). Animate ({scrollTop:obj.position (). top},700);
}

When the above code causes the animation to scroll to the specified position, the animations will be locked out of the relationship because the easing time is too long and the workaround is:

function scroll_to (obj) {
$ (' html,body '). Animate ({scrollTop:obj.position (). top},{queue:false,duration:80});
}

Replace 700 with {queue:false,duration:80} to have the current animation jump out of the animation queue, not subject to the execution limit of the animation queue, immediately.

Parameter explanation:

queue:false--jumps out of the animation queue, giving it immediate priority

duration:80--also refers to the easing time, which is the duration of the animation execution

Animate animation locked in queue how to fix

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.