diff --git a/_layouts/default.html b/_layouts/default.html index 6b776f225b..2169c44aa9 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -5,7 +5,7 @@ {% include header.html %} - + {% include nav-main.html %} diff --git a/assets/js/application.js b/assets/js/application.js index 0435726c9a..99ba1413d6 100644 --- a/assets/js/application.js +++ b/assets/js/application.js @@ -8,11 +8,28 @@ var $window = $(window) + var navHeight = $('.navbar').outerHeight(true) + 10 + + $(document.body).scrollspy({ + target: '.bs-sidebar', + offset: navHeight + }) + // Disable certain links in docs $('.bs-docs-container [href=#]').click(function (e) { e.preventDefault() }) + $(document.body).on('click', '[href^=#]', function (e) { + + var $target = $(this.getAttribute('href')) + + e.preventDefault() // prevent browser scroll + + document.body.scrollTop = + $target.offset().top - + navHeight + 5 // offset scroll by nav + }) // back to top setTimeout(function () { diff --git a/javascript.html b/javascript.html index 51ce7f95fe..e0ddae0a1d 100644 --- a/javascript.html +++ b/javascript.html @@ -8,9 +8,9 @@ lead: "Bring Bootstrap's components to life with over a dozen custom jQuery plug -
+

Individual or compiled

@@ -81,9 +81,9 @@ $('#myModal').on('show.bs.modal', function (e) { -
+

About transitions

For simple transition effects, include transition.js once alongside the other JS files. If you're using the compiled (or minified) bootstrap.js, there is no need to include this—it's already there.

@@ -103,9 +103,9 @@ $('#myModal').on('show.bs.modal', function (e) { -
+

Examples

@@ -339,9 +339,9 @@ $('#myModal').on('hidden.bs.modal', function () { -