Function
对Function类的扩展,only版请使用Como.Function.timeout(fun, 1000);
timeout
设置改方法延迟一定时间后执行,单位毫秒
function test(){ alert("111"); }; test.timeout(1000)//1秒钟后执行
interval
设置改方法间隔一定时间执行一次,单位毫秒
function test(){ alert("111"); }; test.interval(1000)//每隔1秒钟执行一次
bind
设置方法新的作用域(this),并且在新方法的所有参数之前插入一些参数
var test = function(){ var a = [1, 2, 3, 4]; a.each(function(i){ ... }.bind(this)); }
bindEvent
设置方法新的作用域(this),并且接受事件对象,(同prototype中的bindAsEventListener)
var _bind = function(e,param1){ ... }; $("span").on('click', _bind.bindEvent(this, param1));