2011-06-01 104 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);