使用以下bxSlider选项以一次显示4张幻灯片:
minSlides: 4
通过......锁定幻灯片的数量
maxSlides: 4
...为...分配相同的号码
moveSlides: 4
......这三个选项.在你的情况下,它是4.
slideWidth: 200
...当您创建轮播(一次显示多张幻灯片的滑块)时,您需要使用该slideWidth
选项指定单张幻灯片的宽度.
关于你应该注意的旋转木马,还有一件事情不是很明显.在确定您需要的幻灯片数量时,请使用此简单规则:将您计划的总数除以您希望一次显示的幻灯片数量.如果结果是一个整数(例如1,2,3 ......),那就没关系.在你的情况下你应该有4(但那很无聊),8,12,16,20 ...原因是如果你的旋转木马有7张幻灯片(我添加了第8张幻灯片),那么它就不会停止或暂停幻灯片始终如一:
第一步:幻灯片5现在处于第一位置
第二步:幻灯片2现在处于第一位置
第三步:幻灯片6现在处于第一位置
片段
$(function() {
$('.popular').bxSlider({
auto: true,
autoControls: true,
speed: 500,
slideSelector: 'div.item',
minSlides: 4,
maxSlides: 4,
moveSlides: 4,
slideWidth: 200
});
});
.main-content .popular {
background: #fff;
}
.main-content .popular .item {
float: left;
width: 25%;
text-align: center;
position: relative;
padding-bottom: 20px;
}
.main-content .popular .item:after {
content: "";
width: 2px;
height: 100%;
background: #f5f5f5;
position: absolute;
right: 0;
top: 0;
}
.main-content .popular .item p {
text-align: left;
padding-left: 20px;
}
.main-content .popular .item p a {
font-size: 16px;
color: #414a56;
}
1> zer00ne..:
变化
-
如何解决《找不到Digest/MD5.pmdirectadmin》经验,为你挑选了1个好方法。 ... [详细]如何解决《绘制PandasMultiindex条形图》经验,为你挑选了1个好方法。 ... [详细]如何解决《解释替代PHPFor循环语法:for($i=1,$j=0;$i<=10;$j+=$i,print$i,$i++);》经验,为你挑选了0个好方法。 ... [详细]如何解决《如何在外部缓存目录中为文件设置FileProvider》经验,为你挑选了2个好方法。 ... [详细]如何解决《如何验证Materialize下拉列表的选择选项?》经验,为你挑选了2个好方法。 ... [详细]如何解决《如何防止记录pyspark的“已收到答复”和“发送命令”消息》经验,为你挑选了0个好方法。 ... [详细]如何解决《尾递归映射f#》经验,为你挑选了1个好方法。 ... [详细]如何解决《MySQLWorkbench导入限制》经验,为你挑选了0个好方法。 ... [详细]如何解决《在Windows上的PHP7安装中找不到mysqli类》经验,为你挑选了1个好方法。 ... [详细]如何解决《v-for中的计算/动态v模型名称》经验,为你挑选了1个好方法。 ... [详细]如何解决《在嵌套的MongoDB调用中,如何确保原子性?》经验,为你挑选了0个好方法。 ... [详细]如何解决《Intellij-是否存在for循环类型的自动完成?》经验,为你挑选了2个好方法。 ... [详细]如何解决《反向for循环在Postgresql中不起作用》经验,为你挑选了1个好方法。 ... [详细]如何解决《Xamarin表单ListViewCachingStrategy》经验,为你挑选了0个好方法。 ... [详细]如何解决《indexOf显然不应该返回-1》经验,为你挑选了1个好方法。 ... [详细]如何解决《OSError:[Errno107]传输端点未连接》经验,为你挑选了1个好方法。 ... [详细]如何解决《如何使toctree链接引用单独的文件,就像它引用的小节一样》经验,为你挑选了1个好方法。 ... [详细]如何解决《pyodbc无法连接到数据库》经验,为你挑选了1个好方法。 ... [详细]如何解决《最后,除了在python中加注之外,重新发现异常》经验,为你挑选了1个好方法。 ... [详细]如何解决《删除迁移和makemigrations后的django.db.utils.OperationalError》经验,为你挑选了1个好方法。 ... [详细]吐了个 "CAO" !Tags | 热门标签RankList | 热门文章
- 1React.js - 实现组件的排序
- 2Python中的Bokeh包:如何使用rgb进行颜色选择
- 3使用Xcode的测试类助手编辑器和Swift类
- 4在RichTextBox中显示NLog跟踪
- 5bash脚本无法读取第一行
- 6大熊猫建立在Cygwin上
- 7路易吉:一步一步的指示不起作用
- 8C#使自动ToString转换无效
- 9Java关于性能的变量声明之间的区别
- 10直接从Python 3模块导入函数
- 11git"致命:.git/index:索引文件打开失败:权限被拒绝"
- 12从未赋予null的volatile变量是否可以包含null?
- 13Netbeans IDE中的ReactJS/JSX支持
- 14为什么Files.list()并行流的执行速度比使用Collection.parallelStream()慢得多?
- 15生成随机数,以便在后续页面中使用
- 16如何将内存转储到Ollydbg的原始文件中?
- 17使用iCarousel进行无限循环
- 18有没有办法将GIF添加到Markdown文件?
- 19使用字典键转换列表中的元素
- 20如何将JSON对象转换为base64字符串?
DevBox开发工具箱 | 专业的在线开发工具网站 京公网安备 11010802040832号 | 京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有
滑块显示如此多幻灯片的原因是因为您将bxSlider分配给
只有一个巨大的滑块.解决这个问题:
删除
和
重新分配bxSlider插件 指定 在CSS 使用以下bxSlider选项以一次显示4张幻灯片:
关于你应该注意的旋转木马,还有一件事情不是很明显.在确定您需要的幻灯片数量时,请使用此简单规则:将您计划的总数除以您希望一次显示的幻灯片数量.如果结果是一个整数(例如1,2,3 ......),那就没关系.在你的情况下你应该有4(但那很无聊),8,12,16,20 ...原因是如果你的旋转木马有7张幻灯片(我添加了第8张幻灯片),那么它就不会停止或暂停幻灯片始终如一:
第一步:幻灯片5现在处于第一位置 第二步:幻灯片2现在处于第一位置 第三步:幻灯片6现在处于第一位置
slideSelector
.main-content
中使用,但在HTML中有一个.popular-slider
.我换minSlides: 4
通过......锁定幻灯片的数量maxSlides: 4
...为...分配相同的号码moveSlides: 4
......这三个选项.在你的情况下,它是4.slideWidth: 200
...当您创建轮播(一次显示多张幻灯片的滑块)时,您需要使用该slideWidth
选项指定单张幻灯片的宽度.$(function() {
$('.popular').bxSlider({
auto: true,
autoControls: true,
speed: 500,
slideSelector: 'div.item',
minSlides: 4,
maxSlides: 4,
moveSlides: 4,
slideWidth: 200
});
});
.main-content .popular {
background: #fff;
}
.main-content .popular .item {
float: left;
width: 25%;
text-align: center;
position: relative;
padding-bottom: 20px;
}
.main-content .popular .item:after {
content: "";
width: 2px;
height: 100%;
background: #f5f5f5;
position: absolute;
right: 0;
top: 0;
}
.main-content .popular .item p {
text-align: left;
padding-left: 20px;
}
.main-content .popular .item p a {
font-size: 16px;
color: #414a56;
}