jQuery.fx.off
jQuery.fx.off 返回: Boolean
描述: 全局禁用所有動(dòng)畫。
version added: 1.3jQuery.fx.off
當(dāng)這個(gè)屬性設(shè)置為true的時(shí)候,調(diào)用時(shí)所有動(dòng)畫方法將立即設(shè)置元素為他們的最終狀態(tài),而不是顯示效果。這可能令人滿意的幾個(gè)原因:
- jQuery是被用在低資源設(shè)備。
- 動(dòng)畫使用戶遇到可訪問性問題(查看這篇文章獲得更多信息 Turn Off Animation)。
動(dòng)畫可以通過設(shè)置這個(gè)屬性為false重新打開。
Example:
Toggle animation on and off
<!DOCTYPE html>
<html>
<head>
<style>
div { width:50px; height:30px; margin:5px; float:left;
background:green; }
</style>
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
</head>
<body>
<p><input type="button" value="Run"/> <button>Toggle fx</button></p>
<div></div>
<script>
var toggleFx = function() {
$.fx.off = !$.fx.off;
};
toggleFx();
$("button").click(toggleFx)
$("input").click(function(){
$("div").toggle("slow");
});
</script>
</body>
</html>