iamamused
iamamused

Reputation: 2760

Get position of the "viewport" in mobile safari?

Is there a way to determine the position of the "viewport" in mobile safari on a web page? Like x, y, w, h pixel positions of what the phone is currently seeing on the page?

Upvotes: 11

Views: 3117

Answers (1)

Jeethu
Jeethu

Reputation: 429

In javascript (on Mobile Safari) you can use window.pageXOffset and window.pageYOffset to get the x and y offsets, window.innerWidth and window.innerHeight to get w and h.

Upvotes: 3

Related Questions