equalizer
Version:
A simple way to keep elements with equal height without jQuery!
1 lines • 539 B
JavaScript
!function(t,e){"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?module.exports=e():t.Equalizer=e()}(this,function(){var t=function(){"use strict";function t(e){return this instanceof t?"string"==typeof e?void(this.blocks=document.querySelectorAll(e)):void(this.blocks=e):new t(e)}return t.prototype.align=function(){var t,e=0,i=this.blocks.length;for(t=0;i>t;t+=1)this.blocks[t].style.minHeight="",e=Math.max(e,this.blocks[t].clientHeight);for(t=0;i>t;t+=1)this.blocks[t].style.minHeight=e+"px"},t}();return t});