scrollIntoView works well:
element = document.getElementById("divFirst") alignWithTop = true; element.scrollIntoView(alignWithTop);
full reference in the MDN docs:
https://developer.mozilla.org/en-US/docs/Web/API/Element.scrollIntoView
Read full article from html - How do I scroll to an element using JavaScript? - Stack Overflow
No comments:
Post a Comment