mirror of
https://github.com/twbs/bootstrap.git
synced 2025-09-25 21:09:06 +02:00
update docs nav targets
This commit is contained in:
@@ -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 () {
|
||||
|
Reference in New Issue
Block a user