Fixed the start on top on reload
This commit is contained in:
20
index.html
20
index.html
@@ -268,7 +268,7 @@
|
||||
<span class="link-arrow">→</span>
|
||||
</a>
|
||||
|
||||
<a href="https://silverwal.com" class="link" id="portfolio-link">
|
||||
<a href="https://silverwal.com" target="_blank" rel="noopener" class="link" id="portfolio-link">
|
||||
<svg class="link-icon" viewBox="0 0 24 24" fill="currentColor">
|
||||
<path d="M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6zm-1 2l5 5h-5V4zM6 20V4h5v7h7v9H6z"/>
|
||||
</svg>
|
||||
@@ -310,6 +310,18 @@
|
||||
</span>
|
||||
</p>
|
||||
</footer>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
</div>
|
||||
<script>
|
||||
if ('scrollRestoration' in history) {
|
||||
history.scrollRestoration = 'manual';
|
||||
}
|
||||
|
||||
const resetScroll = () => {
|
||||
window.scrollTo(0, 0);
|
||||
};
|
||||
|
||||
window.addEventListener('load', resetScroll);
|
||||
window.addEventListener('pageshow', resetScroll);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user