Window.scrollTo does not work on mobile phones

on my mobile view of my webpage, I can scroll both vertically and horizontally, but it always starts in the upper left corner. Now I want to set the viewport to my custom position using window.scrollTo or something similar. window.scroll seems to work only for desktop browsers.

any idea how i could solve this?

+5
source share
2 answers

I finally got a job.

I had to additionally use the setTimeout function

setTimeout(window.scrollTo(x,y),100);
+3
source

, , . , . , ?

<meta name="viewport" content="width=device-width, initial-scale=1.0">

, div - (320 iPhone), x. y .

0

All Articles