如何使用播放和暂停按钮进行自动幻灯片播放?

问题描述:

在我的应用程序中,我想要一个带有播放和暂停按钮的自动幻灯片放映。如何使用播放和暂停按钮进行自动幻灯片播放?

+0

http://www.google.co.uk/search?q=javascript +幻灯片 – Fenton 2010-02-11 10:30:30

+0

谷歌它 - 有像一个gazillion幻灯片剧本! (感谢c0mrade,刚刚学习SO绳索) – Zinc 2010-02-11 10:33:01

+0

http://speckyboy.com/2009/06/03/15-amazing-jquery-image-galleryslideshow-plugins-and-tutorials/ – s3yfullah 2010-02-11 10:53:45

做这样

<div class="container"> 
    <div id="slides"> 
     <img src="img/example-slide-1.jpg"> 
     <img src="img/example-slide-2.jpg"> 
     <img src="img/example-slide-3.jpg"> 
     <img src="img/example-slide-4.jpg""> 
    </div> 
</div> 


<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script> 
<script src="http://www.slidesjs.com/examples/playing/js/jquery.slides.min.js"></script> 
    <script> 
    $(function() { 
     $('#slides').slidesjs({ 
     width: 940, 
     height: 528, 
     play: { 
      active: true, 
      auto: true, 
      interval: 4000, 
      swap: true, 
      pauseOnHover: true, 
      restartDelay: 2500 
     } 
     }); 
    }); 
    </script>