Difference between revisions of "Template:ETH Zurich"
m |
m |
||
Line 56: | Line 56: | ||
items[i].innerHTML += boxIns; | items[i].innerHTML += boxIns; | ||
} | } | ||
+ | |||
+ | |||
+ | |||
+ | }); | ||
+ | |||
+ | <!-- stolen from https://css-tricks.com/scrollfollow-sidebar/ --> | ||
+ | $(function() { | ||
document.getElementById('sideFiller').style.height = getStyle(document.getElementById('topContainer'),'height'); | document.getElementById('sideFiller').style.height = getStyle(document.getElementById('topContainer'),'height'); | ||
Line 67: | Line 74: | ||
$window.scroll(function() { | $window.scroll(function() { | ||
− | if ($window.scrollTop() > offset | + | if ($window.scrollTop() > offset.top) { |
$sidebar.stop().animate({ | $sidebar.stop().animate({ | ||
marginTop: $window.scrollTop() - offset.top + topPadding | marginTop: $window.scrollTop() - offset.top + topPadding | ||
Line 78: | Line 85: | ||
}); | }); | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | }); | + | }); |
</script> | </script> | ||
Revision as of 11:22, 18 August 2015