$(selector).stop(clearQueue, jumpToEnd)
<!DOCTYPE html>
<html>
<head>
<title> jquery stop() method </title>
<script src = "/ajax/libs/jquery/3.5.1/jquery.min.js"> </script>
<script>
$(document).ready(function() {
$("#start").click(function() {
$("div").text("Welcome to the bianchenghao6.com").animate({ width: 400 }, 2000);
});
$("#stop").click(function() {
$("div").stop();
});
});
</script>
<style>
div {
background: lightgreen;
border: 4px dashed blue;
font-size: 25px;
height: 60px;
width: 60px;
margin-top: 15px;
}
</style>
</head>
<body>
<h4> This is an example of using jQuery's stop() method. </h4>
<button id = "start"> Start </button>
<button id = "stop"> Stop </button>
<div></div>
</body>
</html>
This is an example of using jQuery's stop() method.
<!DOCTYPE html>
<html>
<head>
<title> jquery stop() method </title>
<script src = "/ajax/libs/jquery/3.5.1/jquery.min.js"> </script>
<script>
$(document).ready(function() {
$("#start").click(function() {
$("div").animate({height: 250 }, "slow").text("Welcome to the bianchenghao6.com");
$("div").animate({width: 250 }, "slow");
$("div").animate({height: 50 }, "slow");
$("div").animate({width: 400 }, "slow");
});
$("#stop").click(function() {
$("div").stop(true, true);
});
});
</script>
<style>
div {
background: lightgreen;
border: 4px dashed blue;
font-size: 25px;
height: 60px;
width: 60px;
margin-top: 15px;
}
</style>
</head>
<body>
<h4> This is an example of using jQuery's stop() method. </h4>
<button id = "start"> Start </button>
<button id = "stop"> Stop </button>
<div></div>
</body>
</html>