質問

I got a page with an editor. When i type letters in, the caret usually stays in the same line all the time. But sometimes the caret (plus line) just "wanders" to the top of the visible screen. It is like someone did a scrollIntoView to that line.

I found out that ipad/mobile-safari adjusted the viewport which i did not desire. I can get the former view using a finger: - touch - move down and the viewport is adjusted as before.

But is there a way to this using javascript, or any other workaround?

役に立ちましたか?

解決

I'm not sure is this the problem you're describing where viewport loses it's offset while editing. But if it is, you can try window.scrollTo(0,1) for adjusting the viewport back.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top