为了账号安全,请及时绑定邮箱和手机立即绑定

jquery Timers 介绍与使用

2018.08.30 22:33 776浏览

                                                                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]

点击查看更多内容
0人点赞

若觉得本文不错,就分享一下吧!

评论

相关文章推荐

正在加载中
意见反馈 帮助中心 APP下载
官方微信

举报

0/150
提交
取消