jQuery delay() 方法

來源:互聯網
上載者:User

標籤:執行個體   用法   http   reference   cdn   document   預設   table   html   

定義和用法

delay() 方法對隊列中的下一項的執行設定延遲。

文法$(selector).delay(speed,queueName)
參數 描述
speed 可選。規定延遲的速度。

可能的值:

  • 毫秒
  • "slow"
  • "fast"
queueName 可選。規定隊列的名稱。

預設是 "fx",標準效果隊列。

執行個體代碼

<script src="http://cdn.static.runoob.com/libs/jquery/1.10.2/jquery.min.js"></script><script>$(document).ready(function(){    $("button").click(function(){        $("#div1").delay("slow").fadeIn();        $("#div2").delay("fast").fadeIn();        $("#div3").delay(800).fadeIn();        $("#div4").delay(2000).fadeIn();        $("#div5").delay(4000).fadeIn();    });});</script></head><body><p>這個執行個體使用 delay()  方法來設定不同的速度值。 </p><button>點擊按鈕,顯示多個的 div 框。</button><br><br><div id="div1" style="width:90px;height:90px;display:none;background-color:black;"></div><br><div id="div2" style="width:90px;height:90px;display:none;background-color:green;"></div><br><div id="div3" style="width:90px;height:90px;display:none;background-color:blue;"></div><br><div id="div4" style="width:90px;height:90px;display:none;background-color:red;"></div><br><div id="div5" style="width:90px;height:90px;display:none;background-color:purple;"></div><br></body></html>

 

jQuery delay() 方法

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.