allow fixed subnav to work with navbars of variable height
authorThomas Park <thomas@thomaspark.me>
Tue, 21 Feb 2012 00:20:18 +0000 (19:20 -0500)
committerThomas Park <thomas@thomaspark.me>
Tue, 21 Feb 2012 00:20:18 +0000 (19:20 -0500)
assets/js/application.js

index 732bed4..0cd0384 100755 (executable)
@@ -46,7 +46,8 @@
     // fix sub nav on scroll
     var $win = $(window)
       , $nav = $('.subnav')
-      , navTop = $('.subnav').length && $('.subnav').offset().top - 40
+         , navHeight = $('.navbar').first().height()
+      , navTop = $('.subnav').length && $('.subnav').offset().top - navHeight
       , isFixed = 0
 
     processScroll()