Jssor (nested slider): how to disable AutoPlay?

泪湿孤枕 提交于 2019-12-13 07:26:24

问题


Does anyone know how to prevent the nested slider to start upon loading? I've tried entering "$AutoPlay: false" inside "var nestedSliderOptions", but it doesn't work. Thanks in advance.

source: http://www.jssor.com/download.html examples-jquery > nested-slider.source.html


回答1:


There is no 'auto play' for the main slider and 3 child sliders by default. It is controlled by manual API call.

By removing following code, you will get what you want.

        function OnMainSliderPark(currentIndex, fromIndex) {
            $.each(nestedSliders, function (index, nestedSlider) {
                nestedSlider.$Pause();
            });

            setTimeout(function () {
                nestedSliders[currentIndex].$Play();
            }, 2000);
        }

        jssor_slider1.$On($JssorSlider$.$EVT_PARK, OnMainSliderPark);
        OnMainSliderPark(0, 0);

Also, the grid slider is a variation of nested slider.




回答2:


I don't know this plugin, but according to its documentation in here:

In order to prevent auto play you should call $Pause()

Just call this function right after you are creating the gallery



来源:https://stackoverflow.com/questions/23199359/jssor-nested-slider-how-to-disable-autoplay

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!