2012-05-28 102 views
0

我有這個jQuery -如何停止觸發的延遲?

(function(){ 

jQuery(window).bind('touchstart', function(){ 
    $('#email-info').fadeOut('2400', function() { 
    }); 
}); 

jQuery(window).bind('touchend', function(){ 
    $('#email-info').delay('2800').fadeIn('2400', function() { 
    });  
}); 

})(); 

偉大的工程,但如果我摸我的電話時,它在「延遲」它會淡入/出又迅速。

有沒有辦法阻止它?

+0

你總是可以把touchend的回調函數,因此可以不火,直到動畫cmoplete。 – Ohgodwhy

回答

1
jQuery(window).bind('touchend', function(){ 
    $('#email-info').delay('2800').stop(false,false).fadeIn('2400', function() { 
    });