日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

jquery delay_jQuery delay()函数

發布時間:2024/3/13 编程问答 35 豆豆
生活随笔 收集整理的這篇文章主要介紹了 jquery delay_jQuery delay()函数 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

jquery delay

jQuery delay function is used to delay the execution of items in the queue. This method sets a timer to delay the execution.

jQuery延遲功能用于延遲隊列中項目的執行。 此方法設置計時器以延遲執行。

jQuery delay() (jQuery delay())

Here is the general syntax for using jQuery delay() function:

這是使用jQuery delay()函數的一般語法:

selector.delay(Integer speed, String queueName)

selector.delay(Integer speed, String queueName)

speed defines the duration of the delay effect. Durations are specified in milliseconds.

速度定義延遲效果的持續時間。 持續時間以毫秒為單位。

queueName is the name of the queue on which delay function will execute. This is an optional argument. Default value is fx which is the standard effects queue.

queueName是將在其上執行延遲功能的隊列的名稱。 這是一個可選參數。 默認值為fx ,這是標準效果隊列。

jQuery延遲功能 (jQuery delay function)

Following example demonstrates the application of jQuery delay function to delay animation.

下面的示例演示了jQuery延遲函數在延遲動畫中的應用。

<!doctype html> <html> <head> <title>jQuery delay Function</title> <style> div { position: absolute; width: 70px; height: 70px; float: left; } .div1{ background-color: red; left: 0; } .div2{ background-color: black; left: 80px; } </style> <script src="jquery-3.2.1.min.js"></script> </head> <body> <p><button>jQuery Delay Demo</button></p> <div class="div1"></div> <div class="div2"></div> <script> $( "button" ).click(function() { $( "div.div1" ).toggle( 300 ).delay( 2000 ).fadeIn( 400 ); $( "div.div2" ).toggle( 300 ).slideDown( 1000 ); }); </script> </body> </html>

As you can see that in above example, fadeIn effect is delayed by 2 seconds using jQuery delay() function.

如您所見,在上面的示例中,使用jQuery delay()函數將fadeIn效果延遲了2秒。

Below image shows the jQuery delay function usage in action to delay animation.

下圖顯示了用于延遲動畫的jQuery延遲函數用法。

jQuery延遲動畫直播演示 (jQuery delay animation live demo)

Click on the below button to see the above example output.

單擊下面的按鈕以查看上面的示例輸出。

演示地址

jQuery delay function is very helpful for jQuery animation. This method is added to the 1.4 version of jQuery. This method is used at its best to delay the queued effects in jQuery.

jQuery延遲功能對于jQuery動畫非常有用。 此方法已添加到jQuery的1.4版本中。 最好使用此方法來延遲jQuery中排隊的效果。

Reference: API Doc

參考: API文檔

翻譯自: https://www.journaldev.com/4652/jquery-delay-function

jquery delay

總結

以上是生活随笔為你收集整理的jquery delay_jQuery delay()函数的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。