Salve a tutti.
Sono un principiante.
Ho fatto una galleria immagini come questa.
http://www.creative-ispiration.com/wp-content/tutorial/jquery/jQueryFullScreenGalleryNew/
Adesso per finirla, vorrei aggiungere un pulsante play/pause. per trasformarla in uno slideshow che parte in automatico.
Ho aggiunto questo codice:
//------------------------------------
var myTimer=setInterval(slideshowPlay,3000);
function slideshowPlay(event){
SwitchImage($outer_container.data("nextImage"));
var $this=$("#outer_container a[href='"+$outer_container.data("nextImage")+"']");
GetNextPrevImages($this);
GetImageTitle($this);
SwitchImage($outer_container.data("nextImage"));
}
//bottone play/pause
$('.playPause').toggle(
function(){
clearInterval(myTimer);
},
function(){
setInterval(slideshowPlay,3000);
});
//----------------------------
Risultato:
Lo slideshow parte in automatico(ok); al premere il tasto "play/pause" lo slideshow si ferma(ok
); al premerlo per seconda volta lo slideshow riparte(ok
); ma, al premerlo per terza volta il bottone NON RISPONDE
. Preché?
Come posso farlo funzionare? cosa manca?
grazie dal ascolto.