Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set a number of slides to open when page loads #1147

Closed
brunoDegaspare opened this issue Mar 16, 2015 · 5 comments
Closed

Set a number of slides to open when page loads #1147

brunoDegaspare opened this issue Mar 16, 2015 · 5 comments

Comments

@brunoDegaspare
Copy link

Hi,

First of all I apologise if my question is already answered here as I searched and couldn't find anything.

Ok so I have a 2 rows carousel with 8 slides and my issue is that slick loads all slides first then hides them showing only one slide per time.

Is there a way to set slick to load only one slide per time instead of loading all of them?

@simeydotme
Copy link
Collaborator

JSFiddle, please.

If you're talking about a flash of unstyled content (FOUC) then the solution is to set display:none; on your slides by default, and then set display: block; on slides with .slick-initialized class and to .slick-slide:first-child 😄

@ghost
Copy link

ghost commented Mar 18, 2015

I got FOUC syndrome too, would you put the slick-initialise style in the static css, or would you have to load it in the js?

@mhulse
Copy link

mhulse commented Apr 1, 2015

If you're talking about a flash of unstyled content (FOUC) then the solution is to set display:none; on your slides by default, and then set display: block; on slides with .slick-initialised class and to .slick-slide::first-child

Thanks for tip @simeydotme! 👍

Not a big deal, but here's a slight correction to your code suggestions:

.slick-initialized,
.slick-slide:first-child { display: block; }

Note spelling, and first-child as pseudo-class.

Thanks again!

@simeydotme
Copy link
Collaborator

👍
Thanks, updated my comment for the typo and for the silly Americanizsed mistake ;) snigger

@mhulse
Copy link

mhulse commented Apr 1, 2015

silly Americanzsed mistake ;) snigger

Ah, right! Lol. Funny. 😆

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants