描述: 停止当前正在运行的动画,删除所有排队的动画,并完成匹配元素所有的动画。
.finish( [queue ] )
-
queue类型: String停止动画队列中的名称。
当.finish()
在一个元素上被调用,立即停止当前正在运行的动画和所有排队的动画(如果有的话),并且他们的CSS属性设置为它们的目标值(愚人码头注:就是所有动画的目标值)。所有排队的动画将被删除。
如果第一个参数提供,该字符串表示的队列中的动画将被停止。
.finish()
方法和.stop(true, true)
很相似,.stop(true, true)
将清除队列,并且目前的动画跳转到其最终值。但是,不同的是,.finish()
会导致所有排队的动画的CSS属性跳转到他们的最终值。
动画可能因为全局的$.fx.off
属性设置为 true
而停止。当这样做时,所有动画方法将立即设置元素的css属性为其最终调用后的状态,而不是显示动画效果。
例子:
Click the Go button once to start the animation, and then click the other buttons to see how they affect the current and queued animations.
<!DOCTYPE html> <html> <head> <style>.box { position: absolute; top: 10px; left: 10px; width: 15px; height: 15px; background: black; } #path { height: 244px; font-size: 70%; border-left: 2px dashed red; border-bottom: 2px dashed green; border-right: 2px dashed blue; } button { width: 12em; display: block; text-align: left; margin: 0 auto; } </style> <script src="http://code.jquery.com/jquery-latest.js"></script> </head> <body> <div class="box"></div> <div id="path"> <button id="go">Go</button> <br> <button id="bstt" class="b">.stop(true,true)</button> <button id="bcf" class="b">.clearQueue().finish()</button> <br> <button id="bstf" class="b">.stop(true, false)</button> <button id="bcs" class="b">.clearQueue().stop()</button> <br> <button id="bsff" class="b">.stop(false, false)</button> <button id="bs" class="b">.stop()</button> <br> <button id="bsft" class="b">.stop(false, true)</button> <br> <button id="bf" class="b">.finish()</button> </div> <script> var horiz = $("#path").width() - 20, vert = $("#path").height() - 20; var btns = { bstt: function () { $("div.box").stop(true, true); }, bs: function () { $("div.box").stop(); }, bsft: function () { $("div.box").stop(false, true); }, bf: function () { $("div.box").finish(); }, bcf: function () { $("div.box").clearQueue().finish(); }, bsff: function () { $("div.box").stop(false, false); }, bstf: function () { $("div.box").stop(true, false); }, bcs: function () { $("div.box").clearQueue().stop(); } }; $("button.b").on("click", function () { btns[this.id](); }); $("#go").on("click", function () { $(".box") .clearQueue() .stop() .css({ left: 10, top: 10 }) .animate({ top: vert }, 3000) .animate({ left: horiz }, 3000) .animate({ top: 10 }, 3000); }); </script> </body> </html>
相关推荐
11.javaQueue 接口及其实现类.zip11.javaQueue 接口及其实现类.zip11.javaQueue 接口及其实现类.zip11.javaQueue 接口及其实现类.zip11.javaQueue 接口及其实现类.zip11.javaQueue 接口及其实现类.zip11.javaQueue ...
C语言头文件 QUEUE.HC语言头文件 QUEUE.HC语言头文件 QUEUE.HC语言头文件 QUEUE.HC语言头文件 QUEUE.HC语言头文件 QUEUE.HC语言头文件 QUEUE.HC语言头文件 QUEUE.HC语言头文件 QUEUE.HC语言头文件 QUEUE.HC语言...
jQuery CSS3小鸟飞翔动画特效是一款利用css3的keyframes属性制作的小鸟飞翔动画代码。 js代码 [removed] var timer = setInterval(function(){ $(".box > div").animate({ 'marginLeft': 1000, },{queue:...
jQuery 核心函数 jQuery(expr, [context]) jQuery(html, [ownerDoc]) jQuery(html, props) jQuery(elements) jQuery() jQuery(callback) jQuery 对象访问 each(callback) size() length selector context ...
1143_Printer Queue.cpp 参考代码
描述:支持文件批量上传、选择图片直接上传到服务器显示在界面
232.Implement_Queue_using_Stacks用栈实现队列【LeetCode单题讲解系列】
},{queue:true, duration:5000,complete:function a(){ $(".box > div").css('transform','rotateY(180deg)'); }}).animate({ 'marginLeft': 50, },5000,function(){ $(".box > div").css('transform','rotateY...
首先需要有队列(queue)...——————————————————————————– 先根据参数调用jQuery.speed获取动画相关参数,得到一个类似如下的对象;并且生成动画执行函数doAnimation optall = { comple
本文主要给大家介绍了关于python用队列asyncio.Queue通讯的相关内容,分享出来供大家参考学习,下面话不多说了,来一起看看详细的介绍吧。 asyncio.Queue与其它队列是一样的,都是先进先出,它是为协程定义的 例子...
jQuery ajaxQueue ajaxQueue是一个概念证明jQuery对象,用于使用jQuery的内置排队系统来排队ajax请求。 它既简单又轻巧,并且不够健壮,但是应该为您提供有效地滥用jQuery的队列系统以适合您的项目所需的起点;) ...
# coding=utf-8 # 目录扫描程序 class DirScan(threading.... while not self._queue.empty(): url = self._queue.get() # 单独用一个线程去输出 threading.Thread(target=self.msg()).start() headers = { ......
mapred.capacity-scheduler....mapred.capacity-scheduler.queue.<queue-name>.maximum-capacity:设置调度器中各个queue最大可以占有的容量,默认为-1表示最大可以占有集群100%的资源,和设置为100的效果是一样的。
1. 源码结构 2. 基本使用 3. 源码分析
Queue_ex1.zip Queue_ex1.zip Queue_ex1.zip
Jquery队列函数使用,动画特效,用于学习,方便初学者使用
this.settings.upload_complete_handler = SWFUpload.queue.uploadCompleteHandler; this.settings.queue_complete_handler = this.settings.queue_complete_handler || null; }; })(SWFUpload....
mmc queue system. single queue multiple server
进程间通信之消息队列 ( message queue ) 消息队列是消息的链表,具有特定的格式,并由消息队列标识符标识. 七种进程间通信方式: 一.无名管道( pipe ) 二.有名管道( fifo ) 三.共享内存 ( shared memory ) 四....
Velocity.js 可用于加速 JavaScript 的动画效果。类似 jQuery 的 $.animate() 方法,但无需依赖 jQuery。速度非常快,而且提供一些很酷的动画效果,支持 SVG 和滚动。 示例代码: $element.velocity({ width: ...