Skip to content

Commit

Permalink
Merge branch '2.0-wip' of github.com:twitter/bootstrap into 2.0-wip
Browse files Browse the repository at this point in the history
  • Loading branch information
mdo committed Jan 25, 2012
2 parents 805a965 + a40d499 commit 4793a6f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/assets/css/docs.css
Expand Up @@ -165,6 +165,12 @@ section {
border-right: 0;
}

.subhead .subnav-fixed {
position: fixed;
top: 40px;
z-index:1000;
}


/* Quick links
-------------------------------------------------- */
Expand Down
21 changes: 21 additions & 0 deletions docs/assets/js/application.js
Expand Up @@ -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
Expand Down

0 comments on commit 4793a6f

Please sign in to comment.