Created
May 2, 2018 19:48
-
-
Save michaelbourne/64b216fa64852b15f8d458798fbba058 to your computer and use it in GitHub Desktop.
X Theme / Pro Theme javascript based grid
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
(function($){ | |
$(window).on('ready load resize', function(){ | |
var max = 0, | |
mobile = $(window).width(), | |
numChildren = $('.jsmethodgrid').first().children().size(); | |
$(".jsmethodgrid .x-column").css('min-height','inherit'); | |
if ( mobile > 767 ){ | |
$('.jsmethodgrid .x-column').css({ 'width' : 100/numChildren + '%', 'margin': 0 }); | |
$(".jsmethodgrid .x-column").each(function(index, el) { | |
if( $(this).outerHeight() > max ){ | |
max = $(this).outerHeight(); | |
} | |
}); | |
$(".jsmethodgrid .x-column").css('min-height', max); | |
} else { | |
$('.jsmethodgrid .x-column').css('width','100%'); | |
} | |
}); | |
})(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment