mirror of
https://github.com/bendtherules/UiQuestions.git
synced 2026-08-18 13:52:50 +00:00
This will set history.scrollRestoration to "manual" on page start, if hash starts with "link-"
9 lines
205 B
JavaScript
9 lines
205 B
JavaScript
var hash = window.location.hash;
|
|
var hashName = hash.substring(1, hash.length);
|
|
|
|
if (hashName.startsWith("link-")) {
|
|
if ("scrollRestoration" in history) {
|
|
history.scrollRestoration = "manual";
|
|
}
|
|
}
|