Jssor auto play false(从选项外部访问)

时间:2014-05-04 09:40:16

标签: jquery jssor

var options = {$AutoPlay: true}

var jssor_slider1 = new $JssorSlider$("slider1_container", options);
var jssor_slider2 = new $JssorSlider$("slider2_container", options); 

我有2个幻灯片横幅使用Jssor插件,我的问题是我只需要将其中一个横幅设置为自动播放。

如果我将var选项更改为$ AutoPlay:false,则两个横幅都将停止自动播放。

有没有办法从var jssor_slider2访问选项并将auto play设置为false?

http://www.jssor.com/

1 个答案:

答案 0 :(得分:1)

这里有3个解决方案,

var options = {$AutoPlay: false};

var jssor_slider1 = new $JssorSlider$("slider1_container", options);
var jssor_slider2 = new $JssorSlider$("slider2_container", options); 
jssor_slider1.$Play();

var options = {$AutoPlay: true};

var jssor_slider1 = new $JssorSlider$("slider1_container", options);
var jssor_slider2 = new $JssorSlider$("slider2_container", options); 
jssor_slider2.$Pause();

var options1 = {$AutoPlay: true};
var options2 = {$AutoPlay: false};

var jssor_slider1 = new $JssorSlider$("slider1_container", options1);
var jssor_slider2 = new $JssorSlider$("slider2_container", options2);