Commit a40d4993 authored by Jacob Thornton's avatar Jacob Thornton

make subnav fix

parent c2312220
...@@ -165,6 +165,12 @@ section { ...@@ -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(){ ...@@ -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
......
Markdown is supported
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