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:
@@ -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')
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user