Scroll to top

How to use if condition and change on scroll in jqurey?

 use if condition  and change on scroll in jqurey?

<script src=”https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js”></script>
<script>

$(document).ready(function(){
var $w = $(window).scroll(function(){
    if ( $w.scrollTop() > 1000 ) { 
        alert(“hello”);

     
    } else {
      // …
    }
});
});

</script>

Leave a Reply

Your email address will not be published. Required fields are marked *