当可见内容大于项目计数时 jCarouselLite 错误

发布于 2024-12-09 07:40:51 字数 317 浏览 6 评论 0原文

我正在使用 jCrouselLite。如果我设置可见 3 并且滑块只有单个元素,那么就不会出现任何内容。 如果删除第二个元素注释标签,那么它们都会出现在列表中。 您可以在 jsfiddle 上尝试

解决方案可以是将可见计数设置为元素计数,但这不是我想要的我正在寻找。

看起来这是一个错误。我该如何解决这个问题?

I am using jCrouselLite. if i set visible 3 and if there is only single element for slider so there is no anything appear.
if you remove second element comment tag so both of them appear in the list.
You can try it on jsfiddle

Solution can be that setting visible count to element count but this is not what i am looking for.

It looks this is a bug. How can i solve this problem ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

囍笑 2024-12-16 07:40:51

如果图像数量是一张,为什么不减少可见数量呢?

$('#carousel').jCarouselLite({
    btnNext: ".next",
    btnPrev: ".prev",
    visible: ($("#carousel li img").length>1)?3:2
});

Why don't you decrease the visible count if the number of image is one?

$('#carousel').jCarouselLite({
    btnNext: ".next",
    btnPrev: ".prev",
    visible: ($("#carousel li img").length>1)?3:2
});
青春有你 2024-12-16 07:40:51

尝试一下,

#carousel { 
    border:1px 
    solid black;
    min-width: 0px !important;

}

当其中没有图片时,这将强制轮播 div 为 0px,并且在添加图片时将根据需要增长

http://jsfiddle.net/g6uLj/3/

try this

#carousel { 
    border:1px 
    solid black;
    min-width: 0px !important;

}

this will force the carousel div to be at 0px when there is no picture in it and will grow as much as you need when adding pictures

http://jsfiddle.net/g6uLj/3/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文