Question

J'ai un gros problème avec Jssor Slider, j'ai fait une galerie avec plus de photos lorsque l'accès de l'iPhone 4 Safari n'écrase que l'iPhone 4. sur iPhone 5 Je n'ai pas ce problème.

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);

Était-ce utile?

La solution

Il y a 3 façons de réduire l'impact, s'il vous plaît jetez un essai.

1.SET $ Option de lecture automatique sur FALSE, puis effectuez la lecture automatique par appel API (JSSOR_SLIDER2. $ Lecture ();) après la première échelle.

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 OPTION $ HWA sur FALSE pour désactiver l'accélération matérielle.

3.Définir l'image en format de chargement paresseux pour réduire le chargement au début.

<div><img src2="url" /></div>
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top