gpt4 book ai didi

javascript - 如何选择响应式 jCarousel 上可见项目的数量

转载 作者:行者123 更新时间:2023-12-03 12:04:56 25 4
gpt4 key购买 nike

如何选择 jCarousel 上可见项目的数量?我正在使用这个插件http://sorgalla.com/jcarousel/使用此模板http://sorgalla.com/jcarousel/examples/responsive/

默认情况下,无论我如何更改容器的宽度,最多会出现 3 个元素,我希望至少显示 5 个元素。

最佳答案

此设置可以在文件 jcarousel.responsive.js 中找到,这里是 GitHub 上的响应式轮播示例 https://github.com/jsor/jcarousel/tree/master/examples/responsive .

线条

if (width >= 600) {
width = width / 3;
} else if (width >= 350) {
width = width / 2;
}

分别确定在大于 600 和 350 的屏幕上显示的项目数量,以便在较大的屏幕上显示 4 个元素,在较小的屏幕(移动设备)上仅显示 3 个元素:

if (width >= 600) {
width = width / 4;
} else if (width >= 350) {
width = width / 3;
}

另请注意,一些用户似乎更改了设置“可见”( Setting number of visible images in jCarousel ),此变量似乎对响应式示例没有任何更改。

关于javascript - 如何选择响应式 jCarousel 上可见项目的数量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25225828/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com