Last active
August 29, 2015 14:21
-
-
Save rgbink/0594bb1c04ab819d5146 to your computer and use it in GitHub Desktop.
Set columns to equal heights
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function() { | |
$.fn.setAllToMaxHeight = function() { | |
return this.height(Math.max.apply(this, $.map(this, function(e) { | |
return $(e).height(); | |
}))); | |
}; | |
$(window).load(function() { | |
if ($(window).width() > 991) { | |
$('.widgets.leadthrough.first div[class^="col-"]').setAllToMaxHeight(); | |
$('.widgets.leadthrough.second div[class^="col-"]').setAllToMaxHeight(); | |
} | |
}); | |
$(window).resize(function() { | |
if ($(window).width() > 991) { | |
$('.widgets.leadthrough.first div[class^="col-"]').setAllToMaxHeight(); | |
$('.widgets.leadthrough.second div[class^="col-"]').setAllToMaxHeight(); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment