拥有360+过渡效果很酷,但我只有10张幻灯片。我怎样才能给他们花哨的过渡平等机会炫耀?
在创建JssorSlider对象之前,在option
对象中定义了转换效果。在我看来,我只能选择360中的一个并将其设置在option
中。我可以为每次转换提供随机过渡效果吗?
A.K.A,创建JssorSlider
后,我仍然可以向其应用新的option
值吗?
答案 0 :(得分:3)
您可以指定具有多个过渡的过渡数组。你可以设置$ 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 call $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