国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

jQuery Chinese Reference Manual / jQuery 停止動(dòng)畫(huà)

jQuery 停止動(dòng)畫(huà)

jQuery 停止動(dòng)畫(huà)

實(shí)例

jQuery stop() 滑動(dòng)
演示 jQuery stop() 方法。

jQuery stop() 動(dòng)畫(huà)(帶參數(shù))
演示 jQuery stop() 方法


jQuery stop() 方法

jQuery stop() 方法用于停止動(dòng)畫(huà)或效果,在它們完成之前。

stop() 方法適用于所有 jQuery 效果函數(shù),包括滑動(dòng)、淡入淡出和自定義動(dòng)畫(huà)。

語(yǔ)法:

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

可選的 stopAll 參數(shù)規(guī)定是否應(yīng)該清除動(dòng)畫(huà)隊(duì)列。默認(rèn)是 false,即僅停止活動(dòng)的動(dòng)畫(huà),允許任何排入隊(duì)列的動(dòng)畫(huà)向后執(zhí)行。

可選的 goToEnd 參數(shù)規(guī)定是否立即完成當(dāng)前動(dòng)畫(huà)。默認(rèn)是 false。

因此,默認(rèn)地,stop() 會(huì)清除在被選元素上指定的當(dāng)前動(dòng)畫(huà)。

下面的例子演示 stop() 方法,不帶參數(shù):

實(shí)例

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="http://libs.baidu.com/jquery/1.10.2/jquery.min.js">
</script>
<script> 
$(document).ready(function(){
  $("#flip").click(function(){
    $("#panel").slideDown(5000);
  });
  $("#stop").click(function(){
    $("#panel").stop();
  });
});
</script>
 
<style type="text/css"> 
#panel,#flip
{
	padding:5px;
	text-align:center;
	background-color:#e5eecc;
	border:solid 1px #c3c3c3;
}
#panel
{
	padding:50px;
	display:none;
}
</style>
</head>
<body>
 
<button id="stop">停止滑動(dòng)</button>
<div id="flip">點(diǎn)我向下滑動(dòng)面板</div>
<div id="panel">Hello world!</div>

</body>
</html>

運(yùn)行實(shí)例 ?

點(diǎn)擊 "運(yùn)行實(shí)例" 按鈕查看在線實(shí)例