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?
答案 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);