Home > OS >  Scroll to pageY in JavaScript?
Scroll to pageY in JavaScript?

Time:08-13

When you clicked somewhere on a page, you'll get a PointerEvent, which contains pageY or layerY, meaning a px size from the top of the page.

Well, the above is for to "get" the info, but how do you "set" a pageY to scroll to the position where pageY sized below the top? Thanks.

CodePudding user response:

I believe this is what you are looking for scrollTo

window.scrollTo(X, Y)
  • Related