I am looking for a solution written in plain JavaScript that fires a JS function at a certain percentage of a page scroll (say 80%). I am looking to accomplish something similar to what Waypoints does, without 750 lines of code or using jQuery.
I'm assuming I would figure determine the height of the window then trigger the callback once the scroll point is greater than 80% of the height.
The other requirements here are that I only want it to trigger once. The other concern I have is potential performance issues of constantly polling for the scroll percentage. Is this a valid concern?