Friday, May 17, 2024
 Popular · Latest · Hot · Upcoming
171
rated 0 times [  176] [ 5]  / answers: 1 / hits: 28602  / 12 Years ago, tue, august 7, 2012, 12:00:00

on my mobile view of my webpage i can scroll in vertical and horizontal direction, but this starts always at the top left corner.
Now i want to set the viewport to my custom position with window.scrollTo or something equivalent. window.scroll seem just to work for desktop browser.



any idea how i could solve that?


More From » mobile

 Answers
1

I got it finally working.



i had to use additionally the setTimeout function



setTimeout(window.scrollTo(x,y),100);

[#83797] Monday, August 6, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
luizc

Total Points: 623
Total Questions: 87
Total Answers: 103

Location: Zimbabwe
Member since Sat, Feb 27, 2021
3 Years ago
;