大型监视器上的Jssor过渡问题

时间:2014-09-26 18:59:55

标签: jssor

我在许多不同的网站上使用了jssor滑块,最近在几个不同的网站上出现了问题。当幻灯片在较大的监视器上转换时,背景图像会分解。这是一个示例(http://bit.ly/1DDYmrM)的链接,我正在使用的代码如下。奇怪的是,这突然停止了正常工作。

jQuery(document).ready(function ($) {
var _SlideshowTransitions = [
//Fade
    {$Duration: 700, $Opacity: 2, $Brother: { $Duration: 1000, $Opacity: 2} }
];
var _CaptionTransitions = [];
_CaptionTransitions["WAVE|B"] = { $Duration: 2800, $FlyDirection: 10, $Easing: { $Left: $JssorEasing$.$EaseInWave, $Top: $JssorEasing$.$EaseLinear }, $ScaleHorizontal: 0.2, $Round: { $Left: 1.5} };

var options = {
    $ShowLoading: true,                                 //[Optional] Show loading screen or not default value is false
    $AutoPlay: true,                                    //[Optional] Whether to auto play, to enable slideshow, this option must be set to true, default value is false
    $AutoPlaySteps: 1,                                  //[Optional] Steps to go for each navigation request (this options applys only when slideshow disabled), the default value is 1
    $AutoPlayInterval: 7000,                            //[Optional] Interval (in milliseconds) to go for next slide since the previous stopped if the slider is auto playing, default value is 10000
    $PauseOnHover: false,                               //[Optional] Whether to pause when mouse over if a slideshow is auto playing, default value is false

    $ArrowKeyNavigation: true,                           //[Optional] Allows keyboard (arrow key) navigation or not, default value is false
    $SlideDuration: 600,                                //[Optional] Specifies default duration (swipe) for slide in milliseconds, default value is 400
    $MinDragOffsetToSlide: 20,                          //[Optional] Minimum drag offset to trigger slide , default value is 20
    //$SlideWidth: 600,                                 //[Optional] Width of every slide in pixels, default value is width of 'slides' container
    //$SlideHeight: 300,                                //[Optional] Height of every slide in pixels, default value is height of 'slides' container
    $SlideSpacing: 0,                                   //[Optional] Space between each slide in pixels, default value is 0
    $DisplayPieces: 1,                                  //[Optional] Number of pieces to display (the slideshow would be disabled if the value is set to greater than 1), the default value is 1
    $ParkingPosition: 0,                                //[Optional] The offset position to park slide (this options applys only when slideshow disabled), default value is 0.
    $UISearchMode: 1,                                   //[Optional] The way (0 parellel, 1 recursive, default value is 1) to search UI components (slides container, loading screen, navigator container, direction navigator container, thumbnail navigator container etc).
    $PlayOrientation: 1,                                //[Optional] Orientation to play slide (for auto play, navigation), 1 horizental, 2 vertical, default value is 1
    $DragOrientation: 3,                                //[Optional] Orientation to drag slide, 0 no drag, 1 horizental, 2 vertical, 3 either, default value is 1 (Note that the $DragOrientation should be the same as $PlayOrientation when $DisplayPieces is greater than 1, or parking position is not 0)

    $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,                           //[Required] The way to choose transition to play slide, 1 Sequence, 0 Random
        $ShowLink: 2,                                   //[Required] 0 After Slideshow, 2 Always
        $ContentMode: true                             //[Optional] Whether to involve whole html content of each slide to play slideshow, otherwise otherwise use the main image to play slideshow, default value is false
    },

    $CaptionSliderOptions: {                            //[Optional] Options which specifies how to animate caption
        $Class: $JssorCaptionSlider$,                   //[Required] Class to create instance to animate caption
        $CaptionTransitions: _CaptionTransitions,       //[Required] An array of caption transitions to play caption, see caption transition section at jssor slideshow transition builder
        $PlayInMode: 1,                                 //[Optional] 0 None (no play), 1 Chain (goes after main slide), 3 Chain Flatten (goes after main slide and flatten all caption animations), default value is 1
        $PlayOutMode: 3                                 //[Optional] 0 None (no play), 1 Chain (goes before main slide), 3 Chain Flatten (goes before main slide and flatten all caption animations), default value is 1
    },

    $ArrowNavigatorOptions: {                       //[Optional] Options to specify and enable direction navigator or not
        $Class: $JssorArrowNavigator$,              //[Requried] Class to create direction navigator instance
        $ChanceToShow: 1,                               //[Required] 0 Never, 1 Mouse Over, 2 Always
        $Steps: 1                                       //[Optional] Steps to go for each navigation request, default value is 1, default value is 1
    },

    $NavigatorOptions: {                                //[Optional] Options to specify and enable navigator or not
        $Class: $JssorNavigator$,                       //[Required] Class to create navigator instance
        $ChanceToShow: 2,                               //[Required] 0 Never, 1 Mouse Over, 2 Always
        $AutoCenter: 1,                                 //[Optional] Auto center navigator in parent container, 0 None, 1 Horizontal, 2 Vertical, 3 Both
        $Steps: 1,                                      //[Optional] Steps to go for each navigation request, default value is 1
        $Lanes: 1,                                      //[Optional] Specify lanes to arrange items, default value is 1
        $SpacingX: 4,                                   //[Optional] Horizontal space between each item in pixel, default value is 0
        $SpacingY: 4,                                   //[Optional] Vertical space between each item in pixel, default value is 0
        $Orientation: 1                                 //[Optional] The orientation of the navigator, 1 horizontal, 2 vertical, default value is 1
    }
};
var jssor_slider1 = new $JssorSlider$('slider1_container', options);

function ScaleSlider() {
    var windowWidth = $(window).width();
    if (windowWidth) {
        jssor_slider1.$ScaleWidth(Math.max(windowWidth, 100));
    }
    else
        window.setTimeout(ScaleSlider, 30);
}

//Scale slider after document ready
ScaleSlider();

$(window).bind("load", ScaleSlider);
$(window).bind("resize", ScaleSlider);
$(window).bind("orientationchange", ScaleSlider);

});

0 个答案:

没有答案