8

I am using the Android G1 default web browser, and I am developing in JavaScript - I have trouble getting the real visual width and height when I zoom in or out on a web page.

It seems that I am getting the wrong value out of window.innerWidth, when I am zooming in/out.

What I am trying to do is - showing an element on a visual fixed place, even when I am zooming and scrolling the page. - so the user can always see that element no matter if he is zooming or scrolling.

I already tried using position "fixed" with no success. The use of a viewport meta-tag is probably not a good solution since I don't want to limit the web page dimensions and I do want the zoom feature will be supported.

Does anyone have a solution or an idea how I can achieve this?

mdelolmo
  • 6,417
  • 3
  • 40
  • 58
user510468
  • 81
  • 3
  • Have you found a solution? I am searching any analog or workaround for window.innerWidth – Ilya Izhovkin Feb 01 '11 at 12:42
  • 1
    What are the wrong values of innerWidth - a little more information is needed. innerWidth should be the size of the viewport. – Kinlan May 18 '11 at 13:20

1 Answers1

1

If your're trying to adjust element's position during zooming or scrolling, then it's a bad idea. WebView blocks DOM tree while performing these operations, so it doesn't display any changes you make from scroll and zoom events. Also I noticed that sometimes it fails to redraw DOM tree even after the last scroll or zoom event.

Michael
  • 53,859
  • 22
  • 133
  • 139