Home  >  Article  >  Web Front-end  >  About how to use jQuery stop()

About how to use jQuery stop()

jacklove
jackloveOriginal
2018-05-04 14:46:551705browse

jQuery stop() is widely used in animations, and now it will be introduced in detail.

jQuery The stop() method is used to stop animations or effects before they are completed.

#The stop() method works with all jQuery effects Functions, including slides, fades, and custom animations.

Syntax

$(selector).stop(stopAll,goToEnd);

The optional stopAll parameter specifies whether the animation queue should be cleared. The default is false, which only stops active animations, allowing any queued animations to execute backwards.

The optional goToEnd parameter specifies whether to complete the current animation immediately. The default is false.

So, by default, stop() will clear the current animation specified on the selected element.

The following example demonstrates the stop() method without parameters:

Example

$("#stop").click(function(){  
$("#panel").stop();
 });

This article introduces jQuery stop() in detail. If you want to learn more For relevant knowledge, please pay attention to the php Chinese website.

Related recommendations:

jQuery.ajaxStop() function detailed explanation

jQuery uses ajaxStart() and ajaxStop() methods

Detailed explanation of usage examples of stop() in jquery

The above is the detailed content of About how to use jQuery stop(). For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn