最佳答案
我试图理解 jquery 插件的语法,因为我想把两个插件合并到 还需要能够停止间隔或运行数次的闪光灯。
总之, 这种语法是否与
jQuery.fn.extend({
everyTime: function(interval, label, fn, times) {
return this.each(function() {
jQuery.timer.add(this, interval, label, fn, times);
});
},
oneTime: function(interval, label, fn) {
return this.each(function() {
jQuery.timer.add(this, interval, label, fn, 1);
});
},
这个
$.fn.blink = function(options)
{
因为第一个(没有 =)看起来是一次设置多个方法的一种方法。 是这样吗? 我在这里的时候也是 为什么要向 jquery 对象添加元素和一些逻辑?
jQuery.extend({
timer: {
global: [],
guid: 1,
dataKey: "jQuery.timer",
(这是从计时器插件)