开发者

How to make an automatic slide show with play and pause buttons?

开发者 https://www.devze.com 2022-12-19 17:28 出处:网络
In my application I want an automatic slide show with play 开发者_运维技巧and pause buttons. See this sample http://www.slidesjs.com/examples/playing/

In my application I want an automatic slide show with play 开发者_运维技巧and pause buttons.


  • See this sample http://www.slidesjs.com/examples/playing/
  • Use this JS lib http://www.slidesjs.com/

do like this

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

精彩评论

暂无评论...
验证码 换一张
取 消