Widget:JumpToSegment: Difference between revisions
(Created page with "<script> window.addEventListener('load', function() { var hash = decodeURIComponent(window.location.hash.slice(1)); if (!hash) return; function tryScroll(attemptsLeft) { var el = document.getElementById(hash); if (el) { el.scrollIntoView({behavior: 'instant', block: 'start'}); return; } if (attemptsLeft > 0) { setTimeout(function() { tryScroll(attemptsLeft - 1); }, 200); } } tryScroll(10); }); </script>") |
No edit summary Tag: Reverted |
||
| Line 1: | Line 1: | ||
<script> | <script> | ||
(function() { | |||
var hash = decodeURIComponent(window.location.hash.slice(1)); | var hash = decodeURIComponent(window.location.hash.slice(1)); | ||
if (!hash) return; | if (!hash) return; | ||
| Line 14: | Line 14: | ||
} | } | ||
tryScroll(10); | tryScroll(10); | ||
}); | })(); | ||
</script> | </script> | ||
Revision as of 20:40, 14 August 2026
<script> (function() { var hash = decodeURIComponent(window.location.hash.slice(1)); if (!hash) return; function tryScroll(attemptsLeft) { var el = document.getElementById(hash); if (el) { el.scrollIntoView({behavior: 'instant', block: 'start'}); return; } if (attemptsLeft > 0) { setTimeout(function() { tryScroll(attemptsLeft - 1); }, 200); } } tryScroll(10); })(); </script>