MCPcopy Create free account
hub / github.com/allasca/allasca.github.io / scrollToMark

Function scrollToMark

themes/next/source/js/bookmark.js:10–23  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

8 };
9
10 const scrollToMark = () => {
11 let top = localStorage.getItem('bookmark' + location.pathname);
12 top = parseInt(top, 10);
13 // If the page opens with a specific hash, just jump out
14 if (!isNaN(top) && location.hash === '') {
15 // Auto scroll to the position
16 window.anime({
17 targets : document.scrollingElement,
18 duration : 200,
19 easing : 'linear',
20 scrollTop: top
21 });
22 }
23 };
24 // Register everything
25 const init = function(trigger) {
26 // Create a link element

Callers 1

initFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected