zoukankan      html  css  js  c++  java
  • 解决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

  • 相关阅读:
    python动态规划解决矩阵连乘
    ISCC2019-digdigdig
    MultiSelectComboBox(一)
    中国地图 xaml Canvas
    NotificationObject.cs
    DelegateCommand.cs
    SQL-PIVOT 数据透视 行列转换
    中国行政区域(省,市,县)SQL
    WCF自定义地址路由映射(不用svc文件)
    java下载安装,环境变量,hello world
  • 原文地址:https://www.cnblogs.com/zlog/p/5388077.html
Copyright © 2011-2022 走看看