0👍
You can use the scroll event and fire your function when needed
window.addEventListener('scroll', function(e){
if(e.pageY>window.innerHeight*0.05){
console.log('over 5%'); //use your function here
}
});
Make sure you remove the event listener when you don’t need it anymore or your component unmounts
- [Vuejs]-How to use onchange event on selectize in vuejs?
- [Vuejs]-Errors compiling Vue with TypeScript
Source:stackexchange.com