2013-03-12 80 views

回答

0

你會做這樣的典型方法是,你會前進到下一張幻燈片,隱藏導航控制去到下一個幻燈片,然後之後的setTimeout(),你會顯示導航控件。

你不告訴我們你的HTML所以這裏的一些製造HTML來說明:

HTML:

<button id="nextSlide">Next</button> 

的jQuery:

$("#nextSlide").click(function() { 
    var button = $(this); 

    // go to next slide here 

    // hide next button 
    button.hide(); 

    // after 2 seconds, show the button again 
    setTimeout(function() { 
     button.fadeIn(500); 
    }, 2000); 

}); 

或者,它可以完全用做jQuery動畫像這樣:

$("#nextSlide").click(function() { 
    // go to next slide here 

    // hide next button, delay, then dfade in 
    $(this).fadeOut(200).delay(2000).fadeIn(500); 

}); 
+0

完美謝謝:) – user1044101 2013-03-13 00:43:30

0

您可以使用$。遞送承諾方法來管理週期結束

$('#myslidebutton').click(function() { 
    mybutton = $(this); 
    mybutton.hide(); //or whatever to not allow a click 
    $('div').animate({ // whatever your slide show part is 
     "opacity": "0" 
    }, 1000).promise().done(function() { 
     //after the animation 
     mybutton.delay(1000).show(); 
    }); 
});