miguel-perez / smoothState.js

Unobtrusive page transitions with jQuery.
MIT License
4.43k stars 508 forks source link

Trigger SmoothState (redirect) on scroll #375

Open RFlintstone opened 5 years ago

RFlintstone commented 5 years ago

Is it possible to redirect a visitor to another page with smoothscroll (even if this is a external one such as https://github.com) when I scroll?

I currently detect if a user is scrolling with

window.addEventListener("wheel", myFunction);

function myFunction() { 
alert("You are scrolling");
}

Thanks in advance, Ruben

quadeinc commented 5 years ago

Try this snippet of code:

window.addEventListener("wheel", myFunction);
function myFunction() { 
window.location.href = "http://github.com";
}