style.js 1.51 KB

$(document).on('ready', function ()
{
    var HOME_SLIDER_option_2 =
    {
        $AutoPlay: true,
        $AutoPlaySteps: 1,
//        $AutoPlayInterval: 4000, есть в HOME_SLIDER_option_1
        $PauseOnHover: 1,

        $ArrowKeyNavigation: true,
//        $SlideDuration: 500,     есть в HOME_SLIDER_option_1
        $MinDragOffsetToSlide: 20,

        $SlideSpacing: 0,
        $DisplayPieces: 1,
        $ParkingPosition: 0,
        $UISearchMode: 1,
        $PlayOrientation: 1,
        $DragOrientation: 1,

        $BulletNavigatorOptions: {
            $Class: $JssorBulletNavigator$,
            $ChanceToShow: 2,
            $AutoCenter: 0,
            $Steps: 1,
            $Lanes: 1,
            $SpacingX: 10,
            $SpacingY: 10,
            $Orientation: 1
        },

        $ArrowNavigatorOptions: {
            $Class: $JssorArrowNavigator$,
            $ChanceToShow: 2,
            $AutoCenter: 0
        }
    };

    var HOME_SLIDER = new $JssorSlider$("HOME_SLIDER", $.extend({}, HOME_SLIDER_option_1, HOME_SLIDER_option_2));

    function ScaleHOME_SLIDER ()
    {
        $item = $("#HOME_SLIDER .item").width();

        if ($(window).width())
        {
            $body = $(window).width() - 70;
            HOME_SLIDER.$ScaleWidth(Math.min($body, $item));
        }
        else
        {
            window.setTimeout(ScaleHOME_SLIDER, 30);
        }
    }

    ScaleHOME_SLIDER();

    $(window).bind("resize", ScaleHOME_SLIDER);
    $(window).bind("orientationchange", ScaleHOME_SLIDER);
});