Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Jquery Scroll on div using anchor tag is not Working properly

$(document).ready(function(){
    $("a").on('click', function(event) {
        if (this.hash !== "") {
            event.preventDefault();
            var hash = this.hash;
            $('html, body').animate({
                scrollTop: $(hash).offset().top
            }, 800, function(){
                window.location.hash = hash;
            });
        }
    });
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Jquery #Scroll #div #anchor #tag #Working #properly
ADD COMMENT
Topic
Name
2+6 =