var elementId = "header";
document.getElementById(elementId).scrollIntoView(true);
OR
// Recommend
var elementId = "header";
jQuery('html,body').animate({scrollTop: $('#' + elementId).offset().top}, 1000);
Title:
JS, jquery scroll to element
Description:
var elementId = "header"; document.getElementById(elementId).scrollIntoView(true); OR // Recommend var elementId = "hea...
...
Rating:
4