javascript delay
[javascript]
function delay(fn, delayTime) {
var arr = Array.prototype.slice.call(arguments),
isNum = typeof(delayTime) == 'number';
delayTime = isNum ? delayTime : 0;
arr.splice(0, isNum ? 2 : 1);
return setTimeout(function () {
typeof(fn) == 'function' && fn.apply(null, arr);
}, delayTime);
}
[/javascript]
此函数的作用这里不赘述,不知道的google一下,呵呵.