Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var eqRndHight=function(slctr){
- var maxHeightRnd = 0;
- var styleRnd = 'position: absolute !important; top: -1000em !important; visibility: hidden !important; display: block !important; ';
- $(slctr).each(function(){
- var currentRndHeight = 0;
- if($(this).is(":visible") && $(this).outerHeight()>0){
- this.style.height = 'auto' ;
- currentRndHeight = $(this).height();
- }else{
- var true_element = $(this).clone().attr( 'style', styleRnd ).appendTo( 'body' );
- true_element.style.height = 'auto' ;
- currentRndHeight = true_element.outerHeight();
- true_element.remove();
- }
- maxHeightRnd = maxHeightRnd < currentRndHeight ? currentRndHeight : maxHeightRnd;
- });
- if(maxHeightRnd>0){
- $(slctr).height(maxHeightRnd);
- // console.log(slctr + ' : ' + maxHeightRnd);
- }
- };
- var eqRndHight_run = function() {
- var groups = {};
- $('[data-valign]').each(function(){
- var $this = $(this);
- var group = $this.attr('data-valign');
- if (typeof groups[group] === 'undefined') {
- groups[group] = [];
- }
- groups[group].push( this );
- });
- for( var k in groups ) {
- eqRndHight( groups[k] );
- }
- };
- $(document).on('ready', eqRndHight_run);
- $(window).on('load resize', eqRndHight_run);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement