Gio*_*gio 1 css height flexslider
我正在尝试使用FlexSlider创建响应式滑块.我的目标是让所有幻灯片的最大高度等于.flexslider100%的高度.
以下代码段显示了我的问题:我希望所有幻灯片(红色和绿色)都具有最大高度,覆盖容器高度(独立于其内容).我试着设置height:100%;但它不起作用.我能做什么?
请在下面给出JS代码
function setEqualHeight(selector) {
var heights = new Array();
$(selector).each(function() {
$(this).css('min-height', '0');
$(this).css('max-height', 'none');
$(this).css('height', 'auto');
heights.push($(this).height());
});
var max = Math.max.apply( Math, heights );
$(selector).each(function() {
$(this).css('height', max + 'px');
});
}
setEqualHeight('.slides li');
$(window).resize(function() {
setTimeout(function() {
setEqualHeight('.slides li');
}, 120);
});
$('.flexslider').flexslider({
animation: "slide"
});
Run Code Online (Sandbox Code Playgroud)
请参阅更新窗口调整大小的演示