From fc44fb504f8f32cbd4d797bec4f9185c14a6e237 Mon Sep 17 00:00:00 2001 From: Arijit Kundu Date: Wed, 16 Dec 2020 13:03:30 +0530 Subject: [PATCH] Page returns to correct scroll Position --- src/assets/js/init.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/assets/js/init.js b/src/assets/js/init.js index 0e50e982bd..f015d97d09 100644 --- a/src/assets/js/init.js +++ b/src/assets/js/init.js @@ -198,6 +198,16 @@ window.onload = function() { } } + // ================================================= + // Checking hash in URL + // this function runs when the DOM is ready, i.e. when the document has been parsed + setTimeout(function() { + if (location.hash) { + location.href = location.hash; + } + }, 1000); + + // ================================================= // Chinese spacing if (window.pangu) {