The understanding of the. Stop () method of jquery

Source: Internet
Author: User

jquery Basic Tutorial Fourth Edition p227
$ (document). Ready (function() {$ (functionvar size = Event.type = =) MouseEnter '? 85:75var padding = Event.type = = ' MouseEnter '? 0:5; $ (this). FIND (' img '). Stop (). Animate ({width:size, height:size, Paddingtop: padding, paddingleft:padding}); });});

I'm not quite sure how the Stop method works. The previous misunderstanding is to execute the Stop method before the animation, the animation is not stopped, can be tested, the animation is still executed, has been very confused.

Later view Jqurey API found is the stop the currently-running animation on the matched elements

My understanding is that when mouseenter, there is no animation, it does not matter to stop the animation (do not execute the Stop method), execute the following animate ({...}) The And when the animation is not finished, immediately mouseleave, the stop is executed, immediately stop the current unfinished animation.

The understanding of the. Stop () method of jquery

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.