Search code examples
safarijssor

problems JSSOR Slider


I have a big problem with jssor Slider I made a gallery with more photos when access from iphone 4 safari crashing only iphone 4. On iphone 5 I don't have this problem.

function ScaleSlider() {
    var parentWidth = jssor_slider2.$Elmt.parentNode.clientWidth;
    if (parentWidth)
        jssor_slider2.$ScaleWidth(Math.min(parentWidth, 960));
    else
        window.setTimeout(ScaleSlider, 30);
}

ScaleSlider(); // Here is the problem when the page loading...

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

Solution

  • There are 3 ways to reduce the impact, please kindly have a try.

    1. Set $AutoPlay option to false and then make it auto play by api call (jssor_slider2.$Play();) after the first scale.

    function ScaleSlider() {
        var parentWidth = jssor_slider2.$Elmt.parentNode.clientWidth;
        if (parentWidth)
            jssor_slider2.$ScaleWidth(Math.min(parentWidth, 960));
        else
            window.setTimeout(ScaleSlider, 30);
    }
    
    ScaleSlider(); // Here is the problem when the page loading...
    jssor_slider2.$Play();
    
    $(window).bind("load", ScaleSlider);
    $(window).bind("resize", ScaleSlider);
    $(window).bind("orientationchange", ScaleSlider);
    

    2. Set $HWA option to false to disable hardware acceleration.

    3. Define image in lazy loading format to reduce loading at the beginning.

    <div><img src2="url" /></div>