Reputation: 84
how can prevent to do again scroll event in jquery
$(document).ready(function() {
$(window).scroll(function() {
if($(window).scrollTop() == $(document).height() - $(window).height() ){
console.log('scroll');
}
});
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
`
Upvotes: 0
Views: 44
Reputation: 336
You should catch the event, using it in scroll function as a param. And do, event.preventDefault() or event.stopPropagation()
Upvotes: 1