I have an h1 that is far down a page..
TRIGGER EVENT WHEN SCROLLED TO.
and I want to trigger an alert
Inview library triggered event and works well with jquery 1.8 and higher! https://github.com/protonet/jquery.inview
$('div').on('inview', function (event, visible) {
if (visible == true) {
// element is now visible in the viewport
} else {
// element has gone out of viewport
}
});
Read this https://remysharp.com/2009/01/26/element-in-view-event-plugin