Hauteur images fixées
This commit is contained in:
parent
317b787e74
commit
03805ff4d7
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user