|
|
Line 98: |
Line 98: |
| }); | | }); |
| | | |
− |
| |
− | /* stolen from https://css-tricks.com/scrollfollow-sidebar/ */
| |
− | /*
| |
− | $(function() {
| |
− |
| |
− | document.getElementById('sideFiller').style.height = getStyle(document.getElementById('topContainer'),'height');
| |
− |
| |
− | var $sidebar = $("#sidemenu"),
| |
− | $window = $(window),
| |
− | $bottom = $("#contentContainer"),
| |
− | offset = $sidebar.offset(),
| |
− | offsetbot = $bottom.offset(),
| |
− | topPadding = 50;
| |
− |
| |
− | $window.scroll(function() {
| |
− | if ($window.scrollTop() > offset.top) {
| |
− | if ($window.scrollTop() < $window.height() - offsetbot.top + $bottom.height() - $sidebar.height()) {
| |
− | $sidebar.stop().animate({
| |
− | marginTop: $window.scrollTop() - offset.top + topPadding
| |
− | },duration=200);
| |
− | } else {
| |
− | $sidebar.stop().animate({
| |
− | marginTop: $window.height() - offsetbot.top + $bottom.height() - 2*$sidebar.height()
| |
− | });
| |
− | }
| |
− | } else {
| |
− | $sidebar.stop().animate({
| |
− | marginTop: 0
| |
− | });
| |
− | }
| |
− | });
| |
− |
| |
− |
| |
− | }); */
| |
| </script> | | </script> |
| | | |