Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- jQuery Equal Heights of Divs
- `//Equal Height Divs
- function equalHeight( group ) {
- var tallest = 0;
- group.each(function() {
- var thisHeight = $(this).height();
- if(thisHeight > tallest) {
- tallest = thisHeight;
- }
- });
- group.each(function() {
- $(this).css( "min-height", tallest );
- } );
- }`
- var maxHeight = Math.max.apply(null, $('.common_classname').map(function() {
- return $(this).height();
- }).get());
- $('.common_classname').height(maxHeight);
- function equalHeight( group ) {
- var tallest = 0;
- group.each(function() {
- $(this).css({height:"", "min-height":""});
- var thisHeight = $(this).height();
- if(thisHeight > tallest) {
- tallest = thisHeight;
- }
- });
- group.each(function() {
- $(this).css( "min-height", tallest );
- } );
- }
Add Comment
Please, Sign In to add comment