2012-09-24 32 views
0

您好我現在用彈性圖像幻燈片從這裏下載:縮略圖後彈性圖像幻燈片自動播放簡歷點擊

http://tympanus.net/Tutorials/ElasticSlideshow/index2.html

但點擊縮略圖後自動播放將停止。我想知道如何在幾秒鐘後再次恢復自動播放。我在js中看到了這段代碼:

// click the thumbs 
     this.$thumbs.on('click.eislideshow', function(event) { 

      if(_self.options.autoplay) { 

       clearTimeout(_self.slideshow); 
       _self.options.autoplay = false; 

      } 

      var $thumb = $(this), 
       idx  = $thumb.index() - 1; // exclude sliding div 

      _self._slideTo(idx); 

      return false; 

     }); 

我想知道如何修改它。讓自動播放在5秒或指定的某個持續時間後恢復。謝謝!

回答

1

你可以通過添加以下代碼_self.options.autoplay = false;行後:

setTimeout(function() { 
         _self.options.autoplay = true; 
         _self._startSlideshow(); 
      }, 5000); //restart autoplay after 5 seconds 

應該做你想做的。

+0

完美地工作。謝謝! – Adamtan