Javascript Jssor jQuery在safari上没有响应

Javascript Jssor jQuery在safari上没有响应,javascript,jquery,safari,slider,jssor,Javascript,Jquery,Safari,Slider,Jssor,在谷歌Chrome和Firefox中,它运行良好,但在safari中,它没有响应能力 这是我尝试的代码: var jssor_1_slider = new $JssorSlider$("jssor_1", jssor_1_options); //responsive code begin //you can remove responsive code if you don't want the slider scales while window resizes function Scale

在谷歌Chrome和Firefox中,它运行良好,但在safari中,它没有响应能力

这是我尝试的代码:

var jssor_1_slider = new $JssorSlider$("jssor_1", jssor_1_options);

//responsive code begin
//you can remove responsive code if you don't want the slider scales while window resizes
function ScaleSlider() {
    var refSize = jssor_1_slider.$Elmt.parentNode.clientWidth;
    if (refSize) {
        refSize = Math.min(refSize, 850);
        jssor_1_slider.$ScaleWidth(refSize);
    }
    else {
        window.setTimeout(ScaleSlider, 30);
    }
    console.log(refSize);
}
ScaleSlider();
$(window).bind("load", ScaleSlider);
$(window).bind("resize", ScaleSlider);
$(window).bind("orientationchange", ScaleSlider);
//responsive code end

在safari中,这个滑块的响应性也有一些问题。滑块使用变换来调整滑块大小,但较早版本的safari仅支持-webkit变换。下面的代码将调整滑块的大小。将滑动条的宽度交换为滑动条的宽度,看起来是850

function ScaleSlider() {
    var parentWidth = $('#slider1_container').parent().width();

    if (parentWidth > 320) {
        jssor_slider1.$ScaleWidth(parentWidth);

        // This whole big block is used to handle old-school safari issues with the css "transform" property

        var inner = $('#slider1_container div').first();
        if (inner.css('-webkit-transform') != ""){
            inner.css('webkit-transform', "scale(" + parentWidth / width_of_slider + ")");
        }
        else {
            inner.attr('style', inner.attr('style') + " -webkit-transform: scale(" + parentWidth / width_of_slider + ");");
        }
        if (inner.css('-webkit-transform-origin') != ""){
            inner.css('webkit-transform-origin', "0px 0px 0px");
        }

    }
    else
        window.setTimeout(ScaleSlider, 30);
}

//Scale slider after document ready
ScaleSlider();

//Scale slider while window load/resize/orientationchange.
$(window).bind("load", ScaleSlider);
$(window).bind("resize", ScaleSlider);
$(window).bind("orientationchange", ScaleSlider);
//responsive code end

在safari中,这个滑块的响应性也有一些问题。滑块使用变换来调整滑块大小,但较早版本的safari仅支持-webkit变换。下面的代码将调整滑块的大小。将滑动条的宽度交换为滑动条的宽度,看起来是850

function ScaleSlider() {
    var parentWidth = $('#slider1_container').parent().width();

    if (parentWidth > 320) {
        jssor_slider1.$ScaleWidth(parentWidth);

        // This whole big block is used to handle old-school safari issues with the css "transform" property

        var inner = $('#slider1_container div').first();
        if (inner.css('-webkit-transform') != ""){
            inner.css('webkit-transform', "scale(" + parentWidth / width_of_slider + ")");
        }
        else {
            inner.attr('style', inner.attr('style') + " -webkit-transform: scale(" + parentWidth / width_of_slider + ");");
        }
        if (inner.css('-webkit-transform-origin') != ""){
            inner.css('webkit-transform-origin', "0px 0px 0px");
        }

    }
    else
        window.setTimeout(ScaleSlider, 30);
}

//Scale slider after document ready
ScaleSlider();

//Scale slider while window load/resize/orientationchange.
$(window).bind("load", ScaleSlider);
$(window).bind("resize", ScaleSlider);
$(window).bind("orientationchange", ScaleSlider);
//responsive code end