iosscripts / iosslider

iosslider is a jQuery plugin which allows you to integrate a customizable, cross-browser content slider into your web presence. Designed for use as a content slider, website banner, or image gallery.
http://iosscripts.com/iosslider
432 stars 103 forks source link

"Jumping" slides when startAtSlide is defined #334

Closed JanMesaric closed 10 years ago

JanMesaric commented 10 years ago

I'm experiencing an issue that when I defined startAtSlide for example: 10, the slider gets loaded at slide 1 and waits(I think) for all other slides to load. That means that slide 1 is being shown during the loading period which can take up to half a second. After it is loaded it jumps to the correct slide, which I've defined.

marcwhitbread commented 10 years ago

This is all pre-DOM ready $(document).ready() or page ready $(window).load() depending on which you are using. iosSlider has no control over this. What you can do is apply a style of opacity: 0; to your iosslider element and on your onSliderLoaded callback you can remove the opacity to remove the undesired preloading from the UI.

$(iosslider_element).iosSlider({
    //other stuff
    onSliderLoaded: function(args) {
        $(iosslider_element).css('opacity', 1);
    }
});
JanMesaric commented 10 years ago

Very nice solution, thanks!