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

Graceful slick js loading #779

Closed
ghost opened this issue Nov 12, 2014 · 4 comments
Closed

Graceful slick js loading #779

ghost opened this issue Nov 12, 2014 · 4 comments

Comments

@ghost
Copy link

ghost commented Nov 12, 2014

When a page with slickjs carousel is loading, the images are stacked together crashing the whole layout. My question is how can I add a gif loader to the slick carousel while the page is loading the necessary elements like js and css.

Foundation did something like this on their version of Orbit slider 2 versions back and I wonder if I could do this on slick.js also.

@simeydotme
Copy link
Collaborator

Put a loading image as the background on the slick container, and use CSS to hide all of the container's contents.

.slick-slider {
    background: url(loader.gif);
}
.slick-slider .slick-list { 
    opacity: 0; 
    position: absolute; 
}
.slick-slider.slick-initialized {
    background: none;
}
.slick-slider.slick-initialized .slick-list { 
    opacity: 1;
    position: relative;
    transition: opacity 0.2s ease-in;
}

Something like this will fade the slider in to the container after it has initialized :)


Thanks for your contribution, but this is an implementation issue and not a bug/feature request so it should ideally be place in the reddit / stackoverflow as defined in the CONTRIBUTING.markdown file :)

@ghost
Copy link
Author

ghost commented Nov 13, 2014

thanks!

@0xadri
Copy link

0xadri commented Feb 15, 2016

+1 nice inspiration

@aronmoshe-m
Copy link

+1 appreciated the idea

This issue was closed.
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