Created
March 10, 2015 19:24
-
-
Save jbubriski/2ba5c4df43a446ba2ea3 to your computer and use it in GitHub Desktop.
Make columns equal height.
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
var $mainNavItem = jQuery('#mainNav .two-column-nav'); | |
jQuery($mainNavItem).on('mouseover', function () { | |
var mousedOver = jQuery.data(this, "mousedOver"); | |
if (!mousedOver) { | |
var $this = jQuery(this); | |
var height = 0; | |
$siblings = $this.find('li.level2'); | |
for (var i = 0; i < $siblings.length; i++) { | |
$sibling = $($siblings[i]); | |
if ( $sibling.height() > height) | |
height = $sibling.height(); | |
} | |
for (var i = 0; i < $siblings.length; i++) { | |
$($siblings[i]).css('height', height + 'px'); | |
} | |
jQuery.data(this, "mousedOver", true); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment