You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
xshop/resources/views/segments/floats/SimpleGoTop/SimpleGoTop.js

9 lines
304 B
JavaScript

const scrollBreakpoint = window.innerHeight * 0.2;
window.addEventListener('scroll',function () {
if (window.scrollY > scrollBreakpoint){
document.querySelector('#SimpleGoTop').classList.add('show')
}else{
document.querySelector('#SimpleGoTop').classList.remove('show')
}
});