Trigger events when the window is scrolled to certain positions

You can use onscroll

function testScroll(ev){
    if(window.pageYOffset>400)alert('User has scrolled at least 400 px!');
}
window.onscroll=testScroll

If you want a jQuery solution you can use scroll.

Leave a Comment