1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-09-26 05:19:15 +02:00

make fixing of subnav work again

This commit is contained in:
Mark Otto
2012-06-24 21:07:20 -07:00
parent 6662f62236
commit 508a93d9e3
3 changed files with 16 additions and 14 deletions

View File

@@ -45,8 +45,8 @@
// fix sub nav on scroll
var $win = $(window)
, $nav = $('.subnav')
, navTop = $('.subnav').length && $('.subnav').offset().top - 40
, $nav = $('.navbar-subnav')
, navTop = $('.navbar-subnav').length && $('.navbar-subnav').offset().top - 40
, isFixed = 0
processScroll()
@@ -62,10 +62,10 @@
var i, scrollTop = $win.scrollTop()
if (scrollTop >= navTop && !isFixed) {
isFixed = 1
$nav.addClass('subnav-fixed')
$nav.addClass('navbar-subnav-fixed')
} else if (scrollTop <= navTop && isFixed) {
isFixed = 0
$nav.removeClass('subnav-fixed')
$nav.removeClass('navbar-subnav-fixed')
}
}