如何使光滑的旋转木马图像无限重复 [英] How to make slick carousel images repeat infinitely
问题描述
我在光滑的旋转木马里面有6张图片。它们占据了屏幕的全宽空间,但它们不会无限重复。为了进一步解释,我的意思是我只想使用6张图片,如果他们跳到左边加班,那么他们会一次又一次地从右边出现(他们会不断重复)
I have 6 images inside my slick carousel. They take full width space of the screen but they don't repeat infinitely. To explain it further I mean that I want to use only 6 images and if they skip to the left overtime then they will appear from the right once again and again (They will keep repeating)
推荐答案
您是否有机会使用引导程序?因为它有一个内置的旋转木马,可以无限滑动。看看他们的代码,看看你是否可以模仿他们的逻辑。
Are you using bootstrap by any chance? because it has a built in carousel that can infinitely slide. Check out their code and see if you can imitate their logic.
https://getbootstrap.com/examples/carousel/
编辑**
进一步研究后,这有帮助吗?
after looking further into it, does this help?
$('.multiple-items').slick({
infinite: true,
});
引自: http://kenwheeler.github.io/slick/
我之前没有使用过光滑,但我相信你可以将其'无限属性设置为真。如果有效,请告诉我!
I haven't used slick before, but I believe you can set its' infinite property to true. Let me know if that works!
这篇关于如何使光滑的旋转木马图像无限重复的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!