Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

New Contributor
Posts: 9
Registered: ‎03-05-2011
My Device: 9800
My Carrier: ATT

Determining where the current viewport coordinates are relative to the page

I have been working on this for many, many hours and its frustrating me to no end.  I have a page which renders to about 1000px high in a webworks 2.0 application.  Since the screen size is only 320 (or whatever), I need to know what X,Y coordinate offsets on the page the visual viewport is currently looking at.


Now NONE of the standard stuff works, window.pageYOffset, JQuery ScrollTop - they all return 0 even if im scrolled to the bottom.  I assume this is because when I query the viewport for its size using window.innerWidth/innerHeight, it reports back the height as being 1000px instead of the device resolution and figures nothing is scrolled.


Bottom line, I have got to know what the visual viewport is looking at - How on earth do I get it to work with both BB 5 and BB 6 browsers???


I have the standard  Meta Viewport Tag : <meta name="viewport" id="viewport" content="height=device-height,width=device-width" />