Commit a40d4993 authored by Jacob Thornton's avatar Jacob Thornton
Browse files

make subnav fix

parent c2312220
9 merge requests!14752.0 wip,!1403warningText and warningBackground docs fix,!13512.0 wip - relative font sizes,!1315[2.0-wip] Fix mustache glob when building,!1268[wip-2.0] IE 7/8 Typehead JS fix,!12362.0 wip - Fix for issue #1202,!1219Removed dotted outline on navbar dropdown menu,!1210Missing icon class from examples,!1195Fixed display of secondary container
Showing with 27 additions and 0 deletions
+27 -0
......@@ -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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment