diff --git a/docs/_templates/footer.html b/docs/_templates/footer.html
index 02cb30a6..5b562649 100644
--- a/docs/_templates/footer.html
+++ b/docs/_templates/footer.html
@@ -34,10 +34,11 @@
if ($('#pionav').css('display') !== 'block') {
return;
}
- window.setTimeout('$(window).scrollTop($(window).scrollTop() - 50);', 50);
- $(window).on('hashchange', function(e){
+ function fixScroll() {
$(window).scrollTop($(window).scrollTop() - 50);
- });
+ }
+ window.setTimeout(fixScroll, 50);
+ $(window).on('hashchange', function(e){fixScroll();});
});
};