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

Slick slider image load on a list for a second #3792

Closed
rosansubba opened this issue Jun 13, 2019 · 1 comment
Closed

Slick slider image load on a list for a second #3792

rosansubba opened this issue Jun 13, 2019 · 1 comment

Comments

@rosansubba
Copy link

rosansubba commented Jun 13, 2019

short description of the bug / issue, provide more detail below.
Load image on a list for a second
====================================================================

[ https://i.gyazo.com/3ebf102108f2b746e9897db26bc15595.gif ]

use this jsfiddle to reproduce your bug:
https://i.gyazo.com/3ebf102108f2b746e9897db26bc15595.gif
we will likely close your issue without it.

====================================================================

Steps to reproduce the problem

  1. ...
  2. ...

====================================================================

What is the expected behaviour?

...

====================================================================

What is observed behaviour?

...

====================================================================

More Details

  • Which browsers/versions does it happen on?
  • Which jQuery/Slick version are you using?
  • Did this work before?
@rosansubba rosansubba changed the title Skick slider image load on a list for a second Slick slider image load on a list for a second Jun 13, 2019
@ahmadalfy
Copy link
Collaborator

ahmadalfy commented Jul 16, 2019

This is not an issue with slick. This is because slick fire when the rest of JavaScript is loaded. You probably need to hide the times using CSS when slick is not initialized. Something like the following:

<div class=“my-custom-slider”>
    <div class=“item”><img src=“image.jpg” /></div>
    <div class=“item”><img src=“image.jpg” /></div>
    <div class=“item”><img src=“image.jpg” /></div>
    <div class=“item”><img src=“image.jpg” /></div>
</div>

By hiding all the slides except the first one:

.my-custom-slider .item + .item { display: none; }

Now when slick is initialized, it add a class called slick-initialized to the container. We can use it to display the rest of the items like the following:

.my-custom-slider.slick-initialized .item + .item { display: block; }

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

No branches or pull requests

2 participants