Created
January 9, 2014 18:24
-
-
Save seanwash/8339269 to your computer and use it in GitHub Desktop.
Set all items to a max height base on the elements.
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
$.fn.setAllToMaxHeight = function(){ | |
return this.height( Math.max.apply(this, $.map( this , function(e){ return $(e).height() }) ) ); | |
} | |
// usage: $(‘div.unevenheights’).setAllToMaxHeight() |
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
# Set Element to Min Height | |
# ========================> | |
$.fn.setAllToMinHeight = -> | |
@.css('min-height', Math.max.apply(this, $.map(this, (e) -> | |
$(e).height() | |
))) | |
# useage: $('.equal-height').setAllToMinHeight() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment