jQuery finish()
此方法可以理解完成佇列中的所有動畫。
它能夠停止當前正在執行的動畫,並瞬間實現動畫的最終結果。
語法結構:
[JavaScript] 純文字檢視 複製程式碼jQueryObject.finish([ queueName ])
引數解析:
queueName:可選,指定佇列名稱,預設為"fx",表示jQuery標準的效果佇列。
jQuery1.9版本新增。
程式碼例項:
[HTML] 純文字檢視 複製程式碼執行程式碼<!doctype html> <html> <head> <meta charset="utf-8"> <meta name="author" content="http://www.softwhy.com/" /> <title>螞蟻部落</title> <style> #antzone { width:300px; height: 100px; background-color: #eee; } </style> <script src="http://libs.baidu.com/jquery/1.9.0/jquery.js"></script> <script> $(document).ready(function () { $("#exec").click(function () { var $div = $("#antzone"); $div.animate({ height: "+=300px" }, 2000); $div.animate({ width: "50%" }, 1000); $div.animate({ width: "200px", height: "100px" }, 1000); }); $("#finish").click(function () { $("#$div").finish(); }); }) </script> </head> <body> <p> <input id="exec" type="button" value="執行動畫" /> <input id="finish" type="button" value="立即完成" /> </p> <div id="antzone"></div> </body> </html>
點選"立即完成"按鈕可以立即結束動畫,處於動畫結束狀態。
相關文章
- YarnapplicationhasalreadyexitedwithstateFINISHEDYarnAPP
- YarnapplicationhasalreadyexitedwithstateFINISHED!YarnAPP
- PHP fastcgi_finish_request 方法PHPAST
- PlayMaker的特殊事件FINISHED事件
- wait for possible quiesce finishAIUI
- Spider closed (finished) 沒完成IDE
- 33-TTL Controller for Finished ResourcesController
- svn“Previous operation has not finished; run 'cleanup' if it was interrupted
- 密碼爆破ssh與ftp服務(finish)密碼FTP
- webViewDidFinishLoad 執行多次的問題WebView
- Spring原始碼之九finishRefresh詳解Spring原始碼
- Chrome Network 下邊欄中 Finish 的含義Chrome
- svn報錯“Previous operation has not finished; run 'cleanup' if it was int
- Spring啟動過程——原始碼分析(finishBeanFactoryInitialization(beanFactory))Spring原始碼Bean
- Android 8.0上webView載入url,不回撥onPageFinishedAndroidWebView
- java.lang.NoSuchMethodError: javax.servlet.ServletInputStream.isFinished錯誤JavaErrorServlet
- Nuxt.js 應用中的 page:finish 鉤子詳解UXJS
- svn報錯cleanup failed–previous operation has not finished; run cleanup if it was interrupte...AI
- Nuxt.js 應用中的 page:transition:finish 鉤子詳解UXJS
- svn“Previous operation has not finished; run ‘cleanup‘ if it was interrupted“報錯的解決方法
- Process finished with exit code -1073740791 (0xC0000409)
- V$DATAGUARD_STATS中 transport lag 或 apply finish time 是空值APP
- jQuery初探:自制jQueryjQuery
- 我的’jQuery’和jQueryjQuery
- 我的''jQuery''和jQueryjQuery
- 【Jquery】jquery 基本的動畫jQuery動畫
- 【Jquery】jquery 自定義動畫jQuery動畫
- Spring原始碼解析之八finishBeanFactoryInitialization方法即初始化單例beanSpring原始碼Bean單例
- Detailed Item Cost Report (XML) timed out waiting for the Output Post-processor to finishAIXML
- 【iOS】當我們在application:DidFinishLaunchWithOptions:中返回NO時會發生什麼iOSAPP
- idea使用svn “Previous operation has not finished; run 'cleanup' if it was interrupted“報錯的解決方法Idea
- jQuery :not()jQuery
- jQuery not()jQuery
- jQuery is()jQuery
- jQuery()jQuery
- jQuery on()jQuery
- jQueryjQuery
- JQuery模板外掛-jquery.tmpljQuery