Template:SUSTC-Shenzhen/themeJs
From 2014.igem.org
(Difference between revisions)
(13 intermediate revisions not shown) | |||
Line 1: | Line 1: | ||
<html> | <html> | ||
<footer> | <footer> | ||
- | <script src="https:// | + | <script src="https://2014.igem.org/Team:SUSTC-Shenzhen/js/pace.min.js?action=raw&ctype=text/javascript"></script> |
<script src="//2014.igem.org/Team:SUSTC-Shenzhen/static/js/jquery.pjax.js?action=raw&ctype=text/javascript"></script> | <script src="//2014.igem.org/Team:SUSTC-Shenzhen/static/js/jquery.pjax.js?action=raw&ctype=text/javascript"></script> | ||
- | <script src="// | + | <script src="https://2014.igem.org/Team:SUSTC-Shenzhen/js/bootstrap.min.js?action=raw&ctype=text/javascript"></script> |
<script> | <script> | ||
$.pjax({ | $.pjax({ | ||
Line 45: | Line 45: | ||
window.ga('create', 'UA-42690126-5', 'auto'); | window.ga('create', 'UA-42690126-5', 'auto'); | ||
+ | window.ga('require', 'linkid', 'linkid.js'); | ||
+ | window.ga('require', 'displayfeatures'); | ||
window.ga('send', 'pageview'); | window.ga('send', 'pageview'); | ||
} else { | } else { | ||
Line 52: | Line 54: | ||
</script> | </script> | ||
<script> | <script> | ||
- | $('# | + | $('#page-contents a').click(function() { |
console.log(this.hash); | console.log(this.hash); | ||
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') | if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') | ||
Line 67: | 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