Created
May 2, 2017 21:38
-
-
Save neodigm/9967171378ec895aa8eb426426df0de5 to your computer and use it in GitHub Desktop.
Lightweight Zurb Foundation Equalizer alternative
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
// Lightweight ZF Equalizer alternative | |
// Will make two or more HTML elements the same height | |
// Usage: eq2.makeEqual("[data-equalizer-watch='your_pattern']"); | |
var eq2 = { | |
Mx: 0, | |
makeEqual: function( data_eqlzr_watch ){ | |
$( data_eqlzr_watch ).each(function(){ | |
eq2.Mx = ( this.clientHeight > eq2.Mx ) ? this.clientHeight : eq2.Mx; | |
}); | |
$( data_eqlzr_watch ).css("height", eq2.Mx + "px"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment