Last active
May 10, 2022 20:10
-
-
Save nuxodin/4d3163253662baac593b2484311537f4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!('onscrollend' in document.documentElement)) { | |
document.addEventListener('scroll',function(e){ | |
var scrollPort = e.target | |
clearTimeout(scrollPort._scrollEndTimeout); | |
scrollPort._scrollEndTimeout = setTimeout(function () { | |
const event = new Event('scrollend'); | |
Object.defineProperty(event,'snapTarget',{ | |
get(){ | |
return 'todo'; | |
}, | |
set(){} | |
}) | |
scrollPort.dispatchEvent(event); | |
}, 100); | |
},true); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment