How to Get Scroll Position Every 200 Scroll?
I am trying to get the scroll down and up position at
This Demo but as you can see it is updating the <p> element on every pixel by pixel scroll (Up or Down). But what I need to
only update the <p> on
every 200 scroll until reaching the end of the div (right now the p element is updating on every single scroll ). Here is the code I have:
- $(window).scroll(function () {
- var height = $(window).scrollTop();
- if (height > 200) {
- $('p').html(height);
- }
- });
- <p></p>
- <div>
- <h3> Hello Scrol!</h3>
- </div>
Thanks