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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With