wallop
wallop copied to clipboard
equal height slides
is there an easy way to achieve equal height slides?
Depends on your use case. It should be easy to accomplish with css or some javascript eventually. I don't think it has anything to do with the library. If you'll create some working example I can possibly give you a hint.
Here's what I did to achieve equal height slides. (Only works if there's one slider on the page)
// Ensure slides are the same height
window.onload = function(e){
var maxHeight = 0;
document.querySelectorAll('.Wallop-item').forEach(function(item){
if (item.clientHeight > maxHeight) maxHeight = item.clientHeight;
});
document.querySelectorAll('.Wallop-item').forEach(function(item){
if (maxHeight > 0) item.style.height = maxHeight + 'px';
});
}
FYI: NodeList.prototype.forEach() is not supported in IE.
@honzabilek4 may be you could add a css rule for .Wallop-item?