How does jquery stop animate animation for an element, and how can I tell if it is in an animated state? Go

Source: Internet
Author: User

animation method for stopping elements:stop ()
syntax structure:stop ([Clearqueue],[gotoend])
Both Clearqueue and gotoend are optional parameters, which are Boolean values.
Clearqueue: Do you want to empty the list of animations that are not playing
Gotoend: Whether to jump directly to the end state of the animation being performed

The Stop () method is often used in animation of hover time to avoid the delay animation caused by inconsistent animation effects with the cursor action.
For example:

$(".test").hover(function(){

     $( this ).stop();      .animate({height: "150" ,width: "300" },200); }, function (){      $( this ).stop();      .animate({height: "50" ,width: "100" },3200); }); determines whether an element is animated: if (! $(elememt).is( ":animated" ) ){ //判断元素是否处于动画状态   //如果当前没有进行动画,则添加 }

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.