-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Why is slick adding slick-cloned slides to my slider? #940
Comments
@mdunbavan thanks for contributing 😊 The cloned items are because you have an infinite carousel with 3 slides to show and in center mode. What this means is that Slick needs to place "clones" of those slides at each end of the carousel so that when you approach the end it has a copy to display at the beginning as it "infinitely" goes around. Curiously; what exactly is your problem, and what is the bug with the plugin which you are creating an issue for? 😄 -- if none please kindly close the issue. Regards, Simon. |
I don't know whether to open a new issue or reopen this issue. The problem for me is that when I run the WAVE accessibility tool in Chrome, the cloned slides create alerts that say, "A nearby image has the same alternative text." |
It was doing same for me! I solved with setting infinite to false: $(document).ready(function(){ |
@gretak Thanks. |
But what if I want the infinite slideshow but without html clones ? |
For those willing to hide (or do anything else to) the cloned items in a specific moment, there is a CSS hook: @linorabolini Regarding your question: using |
.slick-cloned slides break React's mouse events like onMouseEnter and onMouseLeave. Turning infinite off fixed it but I still want infinite slides :( |
Having the same issue as g0ddish but with AngularJS |
@decodedcreative It is likely related to how they use synthetic events and not native events. Not that I have a solution yet but hopefully that gets us going in the right direction... |
Hy, same issue but the first element of my slider is a vidéo with autoplay... so when a clone of this slide is created, I have a double sound on background.. |
Same here as @redacherifi ... That really sucks. You can remove the video clone with JS but then on Safari this slide won't show. Solution around @simeydotme @kenwheeler ? |
I've come across the same issue today. It's mainly a problem with video. Never had a problem in the past. Something simple as the below:
This returns incorrectly as |
Ok let's open a new issue, seems not that this one got a reopen. |
@CHEWX @redacherifi New issue here: #2751 |
One faces the same problem using Ember.js (as React/Angular) when either playing video in the slide or showing dynamically changing content. Anyone know a good workaround for this when one wants an Infinite scroll? |
When 2 slick carousel (one have only 1 slide in view other have many, acting as thumb) are in sync & I have a click event on thumbs which re-adjust top carousel on click event, but if the clicked thumb is a cloned version then it gives me negatives slick index which I am able to calculate to the proper one but then thumbs animate all the way to the other side to show non-cloned version. This animation that instead of centering cloned version is going to the non-cloned version is annoying. here is my code if above statement didn't made sense.
|
If you don't need the dots, you can just duplicate the set of slides, and you won't get cloned slides. |
A simple condition as boolean solved it for me.
|
One way to reach inifinity without clones is going back to slide 0 when the last slide is reached.
|
Another reason why cloning might be an issue for a developer - duplicate content is bad for SEO :) |
SEO is server-side, not client-side. Clone is done on the client-side. |
N
Not if you use server side rendering. You can check it with a free tool like https://www.seobility.net/de/seocheck/ if there is duplicate content on your page. |
Well, that's the exception to the rule, yes. |
Adding to this as I feel it's relevant - I'm hitting a scenario where I need an infinite carousel in centre mode, and every visible slide must be clickable. When the last slide in the array is in the leftmost visible position, or the first in the array is in the rightmost, they will be both active and clones, and therefore not clickable. Has anybody else encountered anything like this? |
Yes, but you can use JavaScript and check is element has cloned class, if so, get next. |
Thank's this is perfectly working. Pointing back to the first index 👍 |
This totally worked for me! |
adaptiveHeight: true Thanks. |
Just scroll the same number of slides to show.. thats worked form me, using infinite scroll |
This automatically point back to the first index after some time, depending on the value in autoplaySpeed. If you want to return to the first index by clicking on the next-button, and go to the last index when clicking on the previous button, this code seems to work fine:
|
Hi,
I have setup a slider with the correct js and markup as below:
The above code basically runs through a loop and generates the slides from the loop and adds to them. Then I have the js that initiates the slider and gets data and inputs certain html in the slider:
When I load the page I see that the slides have been cloned. There are only meant to be 2 at this current moment.
Here is what I see in the inspector:
Can anyone please help me here?
Thanks
The text was updated successfully, but these errors were encountered: