Skip to content

Instantly share code, notes, and snippets.

@FinalDestiny
Created January 30, 2018 15:36
Show Gist options
  • Save FinalDestiny/4c8c9ec539b4de06e140a113fca0cc0c to your computer and use it in GitHub Desktop.
Save FinalDestiny/4c8c9ec539b4de06e140a113fca0cc0c to your computer and use it in GitHub Desktop.
<script type="text/javascript">
function equalize_heights() {
var maxHeight = 0, toequalize = jQuery(".equalize").parent();
toequalize.each(function() {
maxHeight = 0;
toequalize.find('.equalize').each(function(){
jQuery(this).height('auto');
if (jQuery(this).height() > maxHeight) { maxHeight = jQuery(this).height(); }
});
toequalize.find(".equalize").height(maxHeight);
});
}
(function($){
$(document).ready(function() {
$('#top-menu li.current-menu-item').first().addClass('current-item');
$('#top-menu li').removeClass('current-menu-item');
$('#top-menu li a').click(function() {
$('#top-menu li').removeClass('current-item');
$(this).parent().addClass('current-item');
});
equalize_heights();
});
})(jQuery);
jQuery(window).on('resize', function() {
equalize_heights();
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment