2
0
mirror of https://github.com/tenrok/bootstrap.git synced 2026-06-05 16:42:29 +03:00

Merge branch '3.0.0-wip' of github.com:twitter/bootstrap into 3.0.0-wip

This commit is contained in:
Mark Otto
2013-07-26 19:26:58 -07:00
3 changed files with 53 additions and 36 deletions
+17
View File
@@ -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 () {