Jssor 随机过渡
Jssor random transition
拥有 360+ 过渡效果很酷,但我只有 10 张幻灯片。我怎样才能给他们花哨的过渡机会平等炫耀?
在创建 JssorSlider 对象之前,在 option
对象中定义了过渡效果。在我看来我只能选择360中的1个并将其设置在option
中。我可以为每个过渡设置随机过渡效果吗?
A.K.A,创建 JssorSlider
后,我是否仍可以为其应用新的 option
值?
您可以指定一个具有多重转换的转换数组。你可以设置 $TransitionsOrder: 0 让它随机播放过渡。
jQuery(document).ready(function ($) {
//Define an array of slideshow transition code
var _SlideshowTransitions = [
{ code1 },
{ code2 },
{ code3 }
];
var options = {
$AutoPlay: true,
$SlideshowOptions: {
$Class: $JssorSlideshowRunner$,
$Transitions: _SlideshowTransitions,
$TransitionsOrder: 0, //The way to choose transition to play slideshow, 1: Sequence, 0: Random
$ShowLink: true
}
};
var jssor_slider1 = new $JssorSlider$('slider1_container', options);
});
创建 JssorSlider 后,您还可以通过 api 调用 $SetSlideshowTransitions(transArray)
.
动态设置转换
jssor_slider1.$SetSlideshowTransitions(transArray);
参考:
http://www.jssor.com/development/slider-with-slideshow-jquery.html
http://www.jssor.com/development/reference-options.html
http://www.jssor.com/development/reference-api.html
拥有 360+ 过渡效果很酷,但我只有 10 张幻灯片。我怎样才能给他们花哨的过渡机会平等炫耀?
在创建 JssorSlider 对象之前,在 option
对象中定义了过渡效果。在我看来我只能选择360中的1个并将其设置在option
中。我可以为每个过渡设置随机过渡效果吗?
A.K.A,创建 JssorSlider
后,我是否仍可以为其应用新的 option
值?
您可以指定一个具有多重转换的转换数组。你可以设置 $TransitionsOrder: 0 让它随机播放过渡。
jQuery(document).ready(function ($) {
//Define an array of slideshow transition code
var _SlideshowTransitions = [
{ code1 },
{ code2 },
{ code3 }
];
var options = {
$AutoPlay: true,
$SlideshowOptions: {
$Class: $JssorSlideshowRunner$,
$Transitions: _SlideshowTransitions,
$TransitionsOrder: 0, //The way to choose transition to play slideshow, 1: Sequence, 0: Random
$ShowLink: true
}
};
var jssor_slider1 = new $JssorSlider$('slider1_container', options);
});
创建 JssorSlider 后,您还可以通过 api 调用 $SetSlideshowTransitions(transArray)
.
jssor_slider1.$SetSlideshowTransitions(transArray);
参考:
http://www.jssor.com/development/slider-with-slideshow-jquery.html http://www.jssor.com/development/reference-options.html http://www.jssor.com/development/reference-api.html