mirror of
https://github.com/nostalgic-css/NES.css.git
synced 2025-08-28 16:30:09 +02:00
docs: fix scroll to top
This commit is contained in:
@@ -199,7 +199,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- FAB Button -->
|
<!-- FAB Button -->
|
||||||
<button type="button" class="nes-btn is-error scroll-btn" :class="{ active: scrollPos > 500 }" @click="toTop"><span><</span></button>
|
<button type="button" class="nes-btn is-error scroll-btn" :class="{ active: scrollPos > 500 }" @click="window.scrollTo({ top:0, behavior: 'smooth' })"><span><</span></button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
@@ -636,14 +636,5 @@ new Vue({
|
|||||||
this.copiedBalloon.display = 'none';
|
this.copiedBalloon.display = 'none';
|
||||||
}, 1000);
|
}, 1000);
|
||||||
},
|
},
|
||||||
toTop() {
|
|
||||||
const scrolling = setInterval(() => {
|
|
||||||
if (window.scrollY > 0) {
|
|
||||||
window.scrollBy(0, -window.scrollY / 10);
|
|
||||||
} else {
|
|
||||||
clearInterval(scrolling);
|
|
||||||
}
|
|
||||||
}, 10);
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user