Created
May 29, 2012 21:53
-
-
Save cwoodcox/2831021 to your computer and use it in GitHub Desktop.
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
$ -> | |
$("#nav-main li").click -> | |
toExpand = $ $(this).data("expand") | |
$(".nav-sub").hide() | |
toExpand.show() | |
if $(this).hasClass("open") | |
$("#nav-sub-group").height(0) unless $(this).siblings().hasClass("open") | |
$("#nav-main li").removeClass("open") | |
else | |
$("#nav-sub-group").height toExpand.height() + parseInt(toExpand.css 'padding-top') + parseInt(toExpand.css 'padding-bottom') | |
$("#nav-main li").removeClass("open") | |
$(this).addClass("open") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment