The scenario is when I scroll in browser it executes
$(window).scroll(function() { ... }
but in same page I have onpopstate function which usually executes when I press back/forward button in browser
window.onpopstate = function(event) { ... }
Here is my complete script on html page
<script>
window.onpopstate = function(event) { ... }
$( document ).ready(function() {
$(window).scroll(function() { ... }
});
</script>
Issue is when I scroll in browser it executes $(window).scroll
as well as window.onpopstate
both the events.
Can anyone help me out here, as how do I prevent executing window.onpopstate
event while scrolling.