I have some jQuery that only needs to do something when the viewport hits the bottom of a specific element.
In this picture u can see 3 color sections. the blue one is what I see when I load my web page. The black one is where the jQuery applies. and I only want to initialize the black jQuery when the Red part is on the screen.
Is this possible? I am not very good with jQuery but I still tried some thing:
HTML:
<row class="teller-wrapper"> </row>
jQuery:
jQuery('.teller-wrapper').waypoint(function(){
console.log("ik ben nu in beeld, lopen met die tellers");
}, {offset: 'bottom-in-view'});
But the console log does not show when I scroll over the red part.
At this point I am trying with the Waypoints jQuery extension but I can't get it to work properly.
- *jQuery Waypoints - v2.0.2
- *Jquery - v1.11.2
I do not mind using something else than Waypoints extension so any suggestion is welcome. In the meantime ill just keep try and error with what I have now.
I hope someone has a solution
Thanks in advance and happy coding.