Scrolling to an element using jQuery
If you need to scroll the page to a specific element, then this jQuery code will help:
$("html, body").scrollTop($('#myElement').offset().top);
where myElement is the ID of an element you need to scroll to.
If you need to scroll the page to a specific element, then this jQuery code will help:
$("html, body").scrollTop($('#myElement').offset().top);
where myElement is the ID of an element you need to scroll to.
Comments