|
1 | | - |
2 | 1 | <script type="text/javascript" src="{{ site.url }}/assets/js/bootstrap.min.js"></script> |
3 | 2 | <script type="text/javascript" src="{{ site.url }}/assets/js/jquery.scrollTo-1.4.3.1-min.js"></script> |
4 | 3 | <script type="text/javascript" src="{{ site.url }}/assets/js/modernizr.custom.js"></script> |
|
12 | 11 | <script> |
13 | 12 | $(function () { |
14 | 13 | $('[data-toggle="tooltip"]').tooltip(); |
15 | | - }) |
| 14 | + |
| 15 | + |
| 16 | + var stickyHeaderTop = $('#related-articles').offset().top; |
| 17 | + $(window).scroll(function () { |
| 18 | + if ($(window).scrollTop() > stickyHeaderTop) { |
| 19 | + $('#related-articles').css({position: 'fixed', top: '0px'}); |
| 20 | + } else { |
| 21 | + $('#related-articles').css({position: 'static', top: '0px'}); |
| 22 | + } |
| 23 | + }) |
| 24 | + |
16 | 25 | </script> |
17 | 26 |
|
18 | 27 | {% if site.owner.google.analytics %} |
19 | 28 | <!-- Asynchronous Google Analytics snippet --> |
20 | 29 | <script> |
21 | | - (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ |
22 | | - (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), |
23 | | - m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) |
24 | | - })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); |
| 30 | + (function (i, s, o, g, r, a, m) { |
| 31 | + i['GoogleAnalyticsObject'] = r; |
| 32 | + i[r] = i[r] || function () { |
| 33 | + (i[r].q = i[r].q || []).push(arguments) |
| 34 | + }, i[r].l = 1 * new Date(); |
| 35 | + a = s.createElement(o), |
| 36 | + m = s.getElementsByTagName(o)[0]; |
| 37 | + a.async = 1; |
| 38 | + a.src = g; |
| 39 | + m.parentNode.insertBefore(a, m) |
| 40 | + })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga'); |
25 | 41 |
|
26 | | - ga('create', '{{ site.owner.google.analytics }}', 'auto'); |
27 | | - ga('send', 'pageview'); |
| 42 | + ga('create', '{{ site.owner.google.analytics }}', 'auto'); |
| 43 | + ga('send', 'pageview'); |
28 | 44 | </script> |
29 | 45 | {% endif %} |
0 commit comments