• 解决jQuery插件sliderjs, 点击插件分页,导航按钮后不能重新开始.


    jQuery SlidesJS - Can't restart animation after clicking on navigation or pagination

    <!DOCTYPE html>
    <html>
    <head>
    <script src="//code.jquery.com/jquery-1.9.1.min.js"></script>
    <script src="http://www.slidesjs.com/examples/playing/js/jquery.slides.min.js"></script>
    <meta charset="utf-8">
    <title>JS Bin</title>
    <style>
    #container {
       800px;
      height: 450px;
      overflow: hidden;
      position: relative;
    }
    .slidesjs-pagination{
      position: absolute;
      bottom: 10px;
      z-index: 9999;
      right: 10px;
    }
    .slidesjs-pagination {
      margin: 7px 0 0;
      float: right;
      list-style: none;
    }
    .slidesjs-pagination li a {
      display: block;
       13px;
      height: 0;
      padding-top: 13px;
      background-image: url(http://www.slidesjs.com/img/pagination.png);
      background-position: 0 0;
      float: left;
      overflow: hidden;
    }
    .slidesjs-pagination li {
      float: left;
      margin: 0 1px;
    }
    .slidesjs-pagination li a.active,
    .slidesjs-pagination li a:hover.active {
      background-position: 0 -13px
    }
    .slidesjs-pagination li a:hover {
      background-position: 0 -26px
    }
    </style>
    </head>
    <body>
    <div id="container">
    <div id="slides">
      <img src="http://www.slidesjs.com/examples/playing/img/example-slide-1.jpg" alt="Photo by: Missy S Link: http://www.flickr.com/photos/listenmissy/5087404401/">
      <img src="http://www.slidesjs.com/examples/playing/img/example-slide-2.jpg" alt="Photo by: Daniel Parks Link: http://www.flickr.com/photos/parksdh/5227623068/">
      <img src="http://www.slidesjs.com/examples/playing/img/example-slide-3.jpg" alt="Photo by: Mike Ranweiler Link: http://www.flickr.com/photos/27874907@N04/4833059991/">
      <img src="http://www.slidesjs.com/examples/playing/img/example-slide-4.jpg" alt="Photo by: Stuart SeegerLink: http://www.flickr.com/photos/stuseeger/97577796/">
    </div>
    </div>
    <script>
    $(function($) {
      var interval = 4000;
      var st = 0;
      var $slides = $('#slides');
      $slides.slidesjs({
         800,
        height: 450,
        play: {
          active: true,
          auto: true,
          interval: interval,
          swap: true,
          pauseOnHover: true
        },
        callback: {
          start: function(number){
            if ( $slides.find('.slidesjs-play').is(':visible')) {
              clearTimeout(st);
              st = setTimeout(function() {
                 $slides.find('.slidesjs-play').click();
              }, interval);
            }
          }
        }
      });
    });
    </script>
    <!-- </body>
    </html> -->
    

      


    在线DEMO: http://jsbin.com/cujeqekate

  • 相关阅读:
    face-morpher过程函数分析
    python,在路径中引用变量的方法
    【django学习】request.POST与request.POST.get两者主要区别
    微信小程序wx.uploadFile的两个坑
    python PIL/cv2/base64相互转换
    OpenCV-Python cv2.imdecode()和cv2.imencode() 图片解码和编码
    cv2.imread()
    详解Ubuntu Server下启动/停止/重启MySQL数据库的三种方式(ubuntu 16.04)
    python使用post请求发送图片并接受图片
    前端 img标签显示 base64格式的 图片
  • 原文地址:https://www.cnblogs.com/zlog/p/5388077.html
Copyright © 2020-2023  润新知