如何让jssor滑块转换为FADE?

时间:2015-03-23 14:30:04

标签: jquery css jssor

我目前正在使用全宽度jssor滑块。

我想拥有以下功能:

  • 子弹过渡
  • 淡出过渡
  • 禁用拖动,或者如果使用拖动,则会执行淡入淡出过渡,而不是向左/向右滑动或向上/向下滑动

1 个答案:

答案 0 :(得分:0)

幻灯片转换仅在“自动播放”中播放。方式。

所有点播导航请求(点击项目符号/箭头/缩略图以及手动拖动任何幻灯片)都会导致向右滑动< - >右键效果。

以下代码将启用淡入淡出幻灯片。

<script>
    jQuery(document).ready(function ($) {

        var _SlideshowTransitions = [
        //Fade
        { $Duration: 1200, $Opacity: 2 }
        ];

        var options = {
            ...,
            $SlideshowOptions: {                                //[Optional] Options to specify and enable slideshow or not
                $Class: $JssorSlideshowRunner$,                 //[Required] Class to create instance of slideshow
                $Transitions: _SlideshowTransitions,            //[Required] An array of slideshow transitions to play slideshow
                $TransitionsOrder: 1,                           //[Optional] The way to choose transition to play slide, 1 Sequence, 0 Random
                $ShowLink: true                                    //[Optional] Whether to bring slide link on top of the slider when slideshow is running, default value is false
            }
        };

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

    });
</script>

参考:http://www.jssor.com/development/slider-with-slideshow-jquery.html

$DragOrientation选项值设置为0将禁用拖动。

<script>
    jQuery(document).ready(function ($) {

        var options = {
            ...,
            $DragOrientation: 0
        };

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

    });
</script>

参考:http://www.jssor.com/development/reference-options.html