diff --git a/js/scratchx.js b/js/scratchx.js index 17db185..5286c20 100644 --- a/js/scratchx.js +++ b/js/scratchx.js @@ -129,7 +129,12 @@ $("[data-action='load-url'] button").click(function(e) { $("[data-staticlink]").click(function(e) { e.preventDefault(); - showPage($(this).attr("data-staticlink")); + var path = $(this).attr("data-staticlink"); + showPage(path); + window.location.hash = $(this).attr('href'); + if ($("body > main > article").has(path).length == 0) { + document.body.scrollTop = 0; + } }); function showPage(path) {