继续浏览精彩内容
慕课网APP
程序员的梦工厂
打开
继续
感谢您的支持,我会继续努力的
赞赏金额会直接到老师账户
将二维码发送给自己后长按识别
微信支付
支付宝支付

jquery Timers 介绍与使用

这个名字没人起
关注TA
已关注
手记 271
粉丝 19
获赞 92

                                                                JQuery Timers JqueryTimers 是一个依赖于jquery进行定时执行js的js代码,代码很短只有100多行的代码,不过十分好玩,jqueryTimer允许你使用毫秒数 "ms" "sd" "s" "das" "ws" "ks"这样的时间单位来进行设置时间,确实很好玩的.   用法:everyTime(interval : Integer | String, [label = interval : String], fn : Function, [times = 0 : Integer], [belay = false : Boolean])    everyTime will add the defined function (fn) as a timed event to run at a given time interval (interval) for a given number of times (times) optionally belaying event triggering if the previous iteration is not complete (belay). If times is set to 0, the number of times the method is called is unbounded. A label is also set for the given timed event either to the provided string (label) or to the string representation of the interval provided. Additionally, the interval can be defined by using a string such as "3s" for 3 seconds.

oneTime(interval : Integer | String, [label = interval : String], fn : Function)

oneTime will call the defined function (fn) a certain amount of time (interval) after being added to the elements in the jQuery object. A label (label) is also set for the timed event either to the provided string (label) or to the string representation of the interval provided.

stopTime([label : Integer | String], [fn : Function])

stopTime will stop any timed events with the provided label (label) and function (fn). If neither is specified, it will stop all timed events acting on the elements in the jQuery object. If only the function is provided, then it will stop all timed events calling that function regardless of label. Finally if only the label is provided, it will stop all timed events given that label at initialization.  示例:[url]http://jquery.offput.ca/every/[/url]

打开App,阅读手记
0人推荐
发表评论
随时随地看视频慕课网APP