Skip to content

Instantly share code, notes, and snippets.

@seanwash
Created January 9, 2014 18:24
Show Gist options
  • Save seanwash/8339269 to your computer and use it in GitHub Desktop.
Save seanwash/8339269 to your computer and use it in GitHub Desktop.
Set all items to a max height base on the elements.
$.fn.setAllToMaxHeight = function(){
return this.height( Math.max.apply(this, $.map( this , function(e){ return $(e).height() }) ) );
}
// usage: $(‘div.unevenheights’).setAllToMaxHeight()
# 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