AliReza Azizi
AliReza Azizi

Reputation: 84

when scroll not finished don't again scroll event

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

Answers (1)

Arturas Lapinskas
Arturas Lapinskas

Reputation: 336

You should catch the event, using it in scroll function as a param. And do, event.preventDefault() or event.stopPropagation()

Upvotes: 1

Related Questions