目前我已经设定,这样,回调执行仅去年在堆栈
var elements = $('#one, $two, #three, #four, #six');
var _temp = 0;
elements.hide(0, function(){
/* by default, the callback will be performed to
every single element in stack */
_temp++; // increment temporary cache
// perform actual callback only on last in list
if (_temp == elements.length) {
// do stuff
}
});
但感觉错了,因为如果我想为另一个回调做同样低于241线,我必须重置_temp
,而且,全局变量只是一团糟。
我怎么能简化这个?
'hide'没有回调作为第一个参数。这没有任何意义。 – VisioN 2012-07-18 07:55:34
Woops,是不是从脚本复制粘贴,忘记了0. – jolt 2012-07-18 08:04:04