Template:SUSTC-Shenzhen/themeJs
From 2014.igem.org
(Difference between revisions)
(8 intermediate revisions not shown) | |||
Line 69: | Line 69: | ||
} | } | ||
}); | }); | ||
+ | $(document.body).scrollspy({ | ||
+ | target: '.bs-docs-sidebar', | ||
+ | offset: 71 | ||
+ | }); | ||
+ | setTimeout(function () { | ||
+ | var $sideBar = $('.bs-docs-sidebar') | ||
+ | |||
+ | $sideBar.affix({ | ||
+ | offset: { | ||
+ | top: function () { | ||
+ | var offsetTop = $sideBar.offset().top | ||
+ | var sideBarMargin = parseInt($sideBar.children(0).css('margin-top'), 10) | ||
+ | var navOuterHeight = $('#index-nav-main').height() | ||
+ | |||
+ | return (this.top = offsetTop - navOuterHeight - sideBarMargin) | ||
+ | }, | ||
+ | bottom: function () { | ||
+ | return (this.bottom = $('.bs-docs-footer').outerHeight(true)) | ||
+ | } | ||
+ | } | ||
+ | }) | ||
+ | }, 100) | ||
</script> | </script> | ||
</footer> | </footer> | ||
</html> | </html> |
Latest revision as of 09:49, 17 October 2014