Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 950
iamamused Avatar asked Apr 11 '10 03:04

iamamused


1 Answers

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.

like image 170
Jeethu Avatar answered Sep 20 '22 20:09

Jeethu