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

时间:2010-02-11 10:18:17

标签: jquery css slideshow

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

1 个答案:

答案 0 :(得分:0)

喜欢这个

<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>