Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'issue-1146' of github.com:linrock/bootstrap into issue-…

…1146
  • Loading branch information...
commit eb4d5b3b23c0843ae9700045c45406028b2adbe0 2 parents dd4f623 + 8bbc06a
@linrock authored
Showing with 27 additions and 0 deletions.
  1. +6 −0 docs/assets/css/docs.css
  2. +21 −0 docs/assets/js/application.js
View
6 docs/assets/css/docs.css
@@ -165,6 +165,12 @@ section {
border-right: 0;
}
+.subhead .subnav-fixed {
+ position: fixed;
+ top: 40px;
+ z-index:1000;
+}
+
/* Quick links
-------------------------------------------------- */
View
21 docs/assets/js/application.js
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.