mirror of
https://github.com/twbs/bootstrap.git
synced 2025-01-17 09:52:29 +01:00
Merge branch '2.0-wip' of github.com:twitter/bootstrap into 2.0-wip
This commit is contained in:
commit
4793a6f8fa
@ -165,6 +165,12 @@ section {
|
||||
border-right: 0;
|
||||
}
|
||||
|
||||
.subhead .subnav-fixed {
|
||||
position: fixed;
|
||||
top: 40px;
|
||||
z-index:1000;
|
||||
}
|
||||
|
||||
|
||||
/* Quick links
|
||||
-------------------------------------------------- */
|
||||
|
@ -116,6 +116,27 @@ $(function(){
|
||||
})
|
||||
})
|
||||
|
||||
// fix sub nav playa
|
||||
var $win = $(window)
|
||||
, $nav = $('.subhead .nav')
|
||||
, navTop = $('.subhead .nav').offset().top - 40
|
||||
, isFixed = 0
|
||||
|
||||
processScroll()
|
||||
|
||||
$win.on('scroll', processScroll)
|
||||
|
||||
function processScroll() {
|
||||
var i, scrollTop = $win.scrollTop()
|
||||
if (scrollTop >= navTop && !isFixed) {
|
||||
isFixed = 1
|
||||
$nav.addClass('subnav-fixed')
|
||||
} else if (scrollTop <= navTop && isFixed) {
|
||||
isFixed = 0
|
||||
$nav.removeClass('subnav-fixed')
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
// JS for javascript demos
|
||||
|
Loading…
x
Reference in New Issue
Block a user