CSS-Tricks / AnythingSlider

A jQuery Slider plugin for anything.
http://css-tricks.github.io/AnythingSlider/
GNU Lesser General Public License v3.0
1.15k stars 380 forks source link

All slides showed during plugin setup #591

Closed jeanmichel14 closed 11 years ago

jeanmichel14 commented 11 years ago

Hi all,

I don't know if this issue has already been treated, but here is what I would like to do. I need a very fluid slider, adjusting height of slides naturally with its contents. Each slide can content an image and a text, but we only control the width of the image.

Before the plugin is initialized, the HTML content is shown : all slides in a single column.

I wish I could display a loader instead of the slides at init, and then display the slides after the plugin is initialized with the right callback.

I tried to do so, but this causes the slides to be badly displayed.

Do you know how I could do that ?

I setup a jsfiddle to illustrate that, I also put a timeout to fake a little loading time. http://jsfiddle.net/gRANL/

Thanks in advance

Regards

Mottie commented 11 years ago

Hi @jeanmichel14!

Sadly, AnythingSlider requires that you either set the dimensions of all images, or initialize the slider after a window load event.

While the page is loading, the images and/or slides won't have the anythingslider class names applied and therefore no css to float, or line up the slides. So you can either apply your own css to the slider container to hide overflowing panels, or hide all slides but the first (not good if javascript is disabled) - as discussed on the FAQ page under image flickering on initialization (aka FOUC) - updated demo

If you so desire, you can use an image loading plugin to show a loader.

jeanmichel14 commented 11 years ago

Hi Mottie, Thank you very much for the quick and good answer. I came up with this solution : http://jsfiddle.net/gRANL/4/. The website is dependent on Javascript, so I will go for this. This is strange, because I tried this kind of thing at first attempt but it did not worked properly. Anyway :) Killer plugin btw ! Regards