Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js scroll to id on body

$("#button").click(function() {
    $('html, body').animate({
        scrollTop: $("#myDiv").offset().top
    }, 2000);
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #scroll #id #body
ADD COMMENT
Topic
Name
8+9 =