Hauteur images fixées

This commit is contained in:
nyanloutre 2018-10-28 17:59:07 +01:00
parent 317b787e74
commit 03805ff4d7
1 changed files with 29 additions and 0 deletions

View File

@ -953,6 +953,35 @@
<?php include('include_foot.html'); ?>
<script>
$('.carousel').each(function(){
var items = $(this).find(".item"),
heights = [],
tallest;
if (items.length) {
function normalizeHeights() {
items.each(function() { //add heights to array
heights.push($(this).height());
});
tallest = Math.max.apply(null, heights); //cache largest value
items.each(function() {
$(this).css('min-height',tallest + 'px');
});
};
normalizeHeights();
$(window).on('resize orientationchange', function () {
tallest = 0, heights.length = 0; //reset vars
items.each(function() {
$(this).css('min-height','0'); //reset min-height
});
normalizeHeights(); //run it again
});
}
})
</script>
</body>
</html>