画廊网格滑块响应式等高框
Gallery Grid Slider Responsive with equal height box
我想创建一个响应相同高度框的画廊网格滑块。
例650px 宽,3 列 2 行以上。
宽 550 像素,低于 2 列和 3 行。
450 像素宽,低于 1 列和 1 行。
我一直在使用这个jQuery插件 https://github.com/liabru/jquery-match-height。
我可以将其与其他插件滑块一起使用还是有其他选择?
(function() {
/* matchHeight example */
$(function() {
// apply your matchHeight on DOM ready (they will be automatically re-applied on load or resize)
var byRow = $('.item-wrapper').hasClass('match-rows');
// apply matchHeight to each item container's items
$('.item-container').each(function() {
$(this).children('.item-query').matchHeight({
byRow: byRow
});
});
});
})();
https://jsfiddle.net/76cx7roy/
在这里:我使用了bxslider。但是问题不是响应将 2 列和 3 行更改为 1 列和 1 行。它仅在加载时工作。
(function() {
/* matchHeight example */
$(function() {
// apply your matchHeight on DOM ready (they will be automatically re-applied on load or resize)
var byRow = $('.item-wrapper').hasClass('match-rows');
// apply matchHeight to each item container's items
$('.item-container').each(function() {
$(this).children('.item-query').matchHeight({
byRow: byRow
});
});
if($(window).width() > 450 && !$(".bx-s").length){
var divs = jQuery(".item-container .item-query");
for(var i = 0; i < divs.length; i+=6) {
divs.slice(i, i+6).wrapAll("<div class='bx-s'></div>");
}
}else{
$(".bx-s .item-query").unwrap();
}
$('.item-container').bxSlider({
nextSelector: '#item-nav-right',
prevSelector: '#item-nav-left',
pager: false,
nextText: 'next',
prevText: 'prev'
});
});
})();
https://jsfiddle.net/k55y6c9h/
相关文章:
- 如何在 JavaScript 和 HTML 中更改对输入框的提示响应
- 将高图饼图中的文本居中显示为响应
- 如何在数据表中设置从Ajax响应选中的复选框
- ng高图表的响应行为,加载时隐藏编译的ng点击xAxis标签
- 弹出框在移动设备上的响应方式
- 尝试使用鼠标点击事件响应编写jQuery HTML5聊天框程序
- 高图热图:单击按钮或复选框时选择所有单元格
- Angular 2:用HTTP响应填充复选框列表
- jQuery UI日期选择器只响应第一个文本框
- 在地图框gl中单击高亮显示特征
- 为什么 mac 浏览器上的选择框没有响应单击事件
- 如何在我的高图表中传递 Ajax 响应数据
- 根据 ajax 响应中的值设置复选框状态
- 响应式文件管理器 9 在 TinyMCE 4 中打开空白对话框
- 我们可以从Facebook共享对话框获得回电响应吗?
- 我可以将表单提交的响应设置为对话框的内容吗?
- Ajax 对对话框窗口的响应在第二次尝试时不显示更改的值
- 画廊网格滑块响应式等高框
- 等高框+观察布局变化
- 如何总结作为变量的单选和复选框响应