Difference between revisions of "Template:ETH Zurich"
m |
m |
||
Line 65: | Line 65: | ||
var $sidebar = $("#sidemenu"), | var $sidebar = $("#sidemenu"), | ||
$window = $(window), | $window = $(window), | ||
− | |||
$bottom = $("#footerContainer"), | $bottom = $("#footerContainer"), | ||
− | + | offset = $sidebar.offset(), | |
+ | offsetbot = $bottom.offset(), | ||
topPadding = 50; | topPadding = 50; | ||
$window.scroll(function() { | $window.scroll(function() { | ||
− | if ($window.scrollTop() > offset.top && $window.scrollTop() < | + | if ($window.scrollTop() > offset.top && $window.scrollTop() < offsetbot.top) { |
$sidebar.stop().animate({ | $sidebar.stop().animate({ | ||
marginTop: $window.scrollTop() - offset.top + topPadding | marginTop: $window.scrollTop() - offset.top + topPadding |
Revision as of 11:20, 18 August 2015