Summary Files Commits Branches @commit @diff @stats
path: root / src / scripts / back-to-top.js
blob: be1a1c3591617dc4aadaa612472b1da3e11b147b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
const scrollBtn = document.getElementById('scrollBtn');

window.onscroll = function() {
	if (window.scrollY >= 800) {
		scrollBtn.style.display = 'block';
	} else {
		scrollBtn.style.display = 'none';
	}
}