Untitled

mail@pastecode.io avatar
unknown
plain_text
3 years ago
510 B
6
Indexable
Never
<script>
        extra=0;
        
        $(window).scroll(function() {

           var scrolledLength = ( $(window).height() + extra ) + $(window).scrollTop(),
               documentHeight = $(document).height();

           if( scrolledLength >= documentHeight ) {

               $("footer").addClass("open");
           }
           else if ( scrolledLength <= documentHeight && $("footer").hasClass('open') ) {
                $("footer").removeClass("open");
                }
        });
    </script>