jQuery
實(shí)例;事件;效能;移動;基礎(chǔ)
#fx
abbr.fractures 骨折;fractured骨折的;for eksempel (Dano-Norwegian=for example) (挪威文)例如;fixed 固定的
##interval
#英[??nt?vl]? ?美[??nt?S[??nt?vl]?
##n.間隔;幕間休息;(數(shù)學(xué))區(qū)間
jquery jQuery.fx.interval 屬性 語法
作用:jQuery.fx.interval 屬性用於改變以毫秒計的動畫運(yùn)行速率。可操作此屬性來調(diào)整動畫運(yùn)行的每秒影格數(shù)。預(yù)設(shè)值是 13 毫秒。此屬性常用於修改動畫運(yùn)行的每秒影格數(shù)。降低這個值能夠讓動畫在更快的瀏覽器中運(yùn)作得更流暢,但這麼做也能影響效能。由於 jQuery 使用一個全域的間隔時間,為了使該屬性生效,動畫應(yīng)該不在運(yùn)行或首先停止所有動畫。此屬性在支援 requestAnimationFrame 屬性的瀏覽器中無效,例如 Google Chrome 11。
語法:jQuery.fx.interval = milliseconds;
##參數(shù):
jquery jQuery.fx.interval 屬性 範(fàn)例
<!DOCTYPE html> <html> <head> <script src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"> </script> <script> $(document).ready(function(){ $("#toggle").on("click",function(){ $("div").toggle(5000); }); $("#interval").on("click",function(){ jQuery.fx.interval = 500; }); }); </script> </head> <body> <button id="toggle">切換 div</button> <button id="interval">以較少的幀數(shù)來運(yùn)行動畫</button> <div style="background:#98bf21;height:100px;width:100px;margin:50px;"> </div> </body> </html>
#點(diǎn)擊 "執(zhí)行實(shí)例" 按鈕查看線上實(shí)例