【问题标题】:Lightslider going reverse after last slideLightslider 在最后一张幻灯片后反转
【发布时间】:2020-06-17 14:01:31
【问题描述】:

我正在使用lightslider - v1.1.6,但在最后一张幻灯片之后它会反转。

在最后一张幻灯片(第二张图片)之后,滑块再次反向旋转到第一张图片。我希望它继续朝着正确的方向前进,而不是回到最初的方向。

这个问题只发生在 IE 中,但它在 chrome 上运行良好。

JS 文件:

/*! lightslider - v1.1.6 - 2016-10-25
* https://github.com/sachinchoolur/lightslider
* Copyright (c) 2016 Sachin N; Licensed MIT */
(function ($, undefined) {
    'use strict';
    var defaults = {
        animationLoop: false,
        item: 2,
        autoWidth: false,
        slideMove: 1,
        slideMargin: 10,
        addClass: '',
        mode: 'slide',
        useCSS: true,
        cssEasing: 'ease', //'cubic-bezier(0.25, 0, 0.25, 1)',
        easing: 'linear', //'for jquery animation',//
        speed: 400, //ms'
        auto: false,
        pauseOnHover: false,
        loop: false,
        slideEndAnimation: true,
        pause: 2000,
        keyPress: false,
        controls: true,
        prevHtml: '',
        nextHtml: '',
        rtl: false,
        adaptiveHeight: false,
        vertical: false,
        verticalHeight: 500,
        vThumbWidth: 100,
        thumbItem: 10,
        pager: true,
        gallery: false,
        galleryMargin: 5,
        thumbMargin: 5,
        currentPagerPosition: 'middle',
        enableTouch: true,
        enableDrag: true,
        freeMove: true,
        swipeThreshold: 40,
        responsive: [],
        /* jshint ignore:start */
        onBeforeStart: function ($el) {},
        onSliderLoad: function ($el) {},
        onBeforeSlide: function ($el, scene) {},
        onAfterSlide: function ($el, scene) {},
        onBeforeNextSlide: function ($el, scene) {},
        onBeforePrevSlide: function ($el, scene) {}
        /* jshint ignore:end */
    };
    $.fn.lightSlider = function (options) {

                          .....
                          .....
                          .....
                          .....
        return this;
    };
}(jQuery));

这是 html 文件。

HTML:

<div class="demo">
        <div class="item">            
            <div class="clearfix" style="max-width:474px;">
                <ul id="image-gallery" class="gallery list-unstyled cS-hidden">
                    <li> 
                        <img src="/img/banner_home1.jpg" />
                    </li>
                    <li> 
                        <img src="/img/banner_home2.jpg" />
                    </li>
                </ul>
            </div>
        </div>
    </div>  

【问题讨论】:

    标签: javascript slider gallery


    【解决方案1】:

    不能直接解决您的问题,但您不应该适应任何版本的 Internet Explorer。 Microsoft 强烈建议用户停止使用 Internet Explorer 浏览器。现在,如果 Edge 中存在此问题,那么您可能有合理的担忧。

    【讨论】:

      【解决方案2】:

      将循环设置为真

      /*! lightslider - v1.1.6 - 2016-10-25
      * https://github.com/sachinchoolur/lightslider
      * Copyright (c) 2016 Sachin N; Licensed MIT */
      (function ($, undefined) {
          'use strict';
          var defaults = {
              animationLoop: false,
              item: 2,
              autoWidth: false,
              slideMove: 1,
              slideMargin: 10,
              addClass: '',
              mode: 'slide',
              useCSS: true,
              cssEasing: 'ease', //'cubic-bezier(0.25, 0, 0.25, 1)',
              easing: 'linear', //'for jquery animation',//
              speed: 400, //ms'
              auto: false,
              pauseOnHover: false,
              loop: true,
              slideEndAnimation: true,
              pause: 2000,
              keyPress: false,
              controls: true,
              prevHtml: '',
              nextHtml: '',
              rtl: false,
              adaptiveHeight: false,
              vertical: false,
              verticalHeight: 500,
              vThumbWidth: 100,
              thumbItem: 10,
              pager: true,
              gallery: false,
              galleryMargin: 5,
              thumbMargin: 5,
              currentPagerPosition: 'middle',
              enableTouch: true,
              enableDrag: true,
              freeMove: true,
              swipeThreshold: 40,
              responsive: [],
              /* jshint ignore:start */
              onBeforeStart: function ($el) {},
              onSliderLoad: function ($el) {},
              onBeforeSlide: function ($el, scene) {},
              onAfterSlide: function ($el, scene) {},
              onBeforeNextSlide: function ($el, scene) {},
              onBeforePrevSlide: function ($el, scene) {}
              /* jshint ignore:end */
          };
          $.fn.lightSlider = function (options) {
      
                                .....
                                .....
                                .....
                                .....
              return this;
          };
      }(jQuery));
      

      【讨论】:

        猜你喜欢
        • 2021-01-17
        • 2013-08-24
        • 1970-01-01
        • 2012-12-24
        • 2013-04-29
        • 1970-01-01
        • 2019-02-11
        • 1970-01-01
        • 2017-11-02
        相关资源
        最近更新 更多