1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-10-01 15:56:45 +02:00

fix affix…

This commit is contained in:
fat
2013-07-25 23:30:13 -07:00
parent 124d7e6279
commit f5f04ae4a0
5 changed files with 46 additions and 13 deletions

View File

@@ -13,12 +13,23 @@
e.preventDefault()
})
// back to top
setTimeout(function () {
$('.bs-sidebar').affix({
var $sideBar = $('.bs-sidebar')
$sideBar.affix({
offset: {
top: function () { return $window.width() <= 980 ? 290 : 210 }
, bottom: 270
top: function () {
var offsetTop = $sideBar.offset().top
var sideBarMargin = parseInt($sideBar.children(0).css('margin-top'), 10)
var navOuterHeight = $('.bs-docs-nav').height()
return (this.top = offsetTop - navOuterHeight - sideBarMargin)
}
, bottom: function () {
return (this.bottom = $('.bs-footer').outerHeight(true))
}
}
})
}, 100)