mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-15 10:05:40 +02:00
Merge branch '2.0-wip' of github.com:twitter/bootstrap into 2.0-wip
This commit is contained in:
@@ -165,6 +165,12 @@ section {
|
|||||||
border-right: 0;
|
border-right: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.subhead .subnav-fixed {
|
||||||
|
position: fixed;
|
||||||
|
top: 40px;
|
||||||
|
z-index:1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Quick links
|
/* 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
|
// JS for javascript demos
|
||||||
|
Reference in New Issue
Block a user