2011-06-01 64 views
2

我想延迟slideOutItem 500毫秒。无法工作。延迟Javascript效果500毫秒

if(current === idx) { 
    slideOutItem($menuItems.eq(current), false, 250, 'easeOutQuint', true); 
    current = -1; 
} 

回答

2

像这样的事情

if(current === idx) { 
    setTimeout(function() { 
     slideOutItem($menuItems.eq(current), false, 250, 'easeOutQuint', true); 
    } , 500); 
    current = -1; 
} 
+0

这是伟大的,感谢的人! – Aleksi 2011-06-02 18:13:29

0
function delayed_one () 
{ 
    if(current === idx) { 
     slideOutItem($menuItems.eq(current), false, 250, 'easeOutQuint', true); 
     current = -1; 
    } 
} 

setTimeout (delayed_one, 500);