Welcome!

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

Reply
New Developer
ozzob1
Posts: 10
Registered: ‎08-22-2008

v4.6.0 and window.innerWidth property

In the v4.6.0 JavaScript reference documentation, there is two properties for the Window object : innerWidth and innerHeight (available since v3.8).

But, when i try to read it in v4.6.0 Blackberry simulator, these properties don't exist (window.innerWidth undefined).

 

Does these properties really exist ?

 

I would like to position an iframe in the upper right corner of the browser display area. I set iframe position to fixed.

How could i know the browser display area height and width ?

 

Thanks

 

Please use plain text.
Administrator
MSohm
Posts: 14,073
Registered: ‎07-09-2008
My Carrier: Bell

Re: v4.6.0 and window.innerWidth property

Please verify that JavaScript has been enabled.  You can set this by opening the browser, selecting Options from the menu, then Browser Configuration.  You can enable/disable JavaScript from there.
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
New Developer
ozzob1
Posts: 10
Registered: ‎08-22-2008

Re: v4.6.0 and window.innerWidth property

Yes, Javascript is enabled. And if I execute this code :

for (var i in window)

alert(i);

 

I see all window properties but not innerWidth and innerHeight.

Please use plain text.
Administrator
MSohm
Posts: 14,073
Registered: ‎07-09-2008
My Carrier: Bell

Re: v4.6.0 and window.innerWidth property

I have been able to reproduce this in the version 4.6.0 BlackBerry Simulator.  However, it appears that the issue has been resolved as these properties do work in the version 4.7.0 BlackBerry Simulator.
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
New Developer
dtrinka
Posts: 3
Registered: ‎11-02-2009

Re: v4.6.0 and window.innerWidth property

 

Its fine and good that this works in 4.7, but what can we do in 4.6? screen.availHeight isn't usable here because it does NOT exclude the "banners".

 

The space consumed by the banner(s) depends on the OS version and is also controlled by a user setting (they can toggle it by using the "u" shortcut). This is made worse in the AT&T build (v4.6.0.297 platform 4.0.0.247) because the MediaNet browser includes a "ATT" bar on the bottom where the Hotspot browser does NOT - so we can't even use navigator.userAgent to determine the right hard coded value.

 

Please use plain text.
New Developer
dtrinka
Posts: 3
Registered: ‎11-02-2009

Re: v4.6.0 and window.innerWidth property

Let me fine tune this a bit.

 

window.innerHeight is

undefined in v4.6.0.297 platform 4.0.0.247 (on Bold) BUT

defined in v4.6.1.231 platform 4.2.0.108 (on Curve).

 

The Curve also correctly excludes the "banner" from the height.


Please use plain text.
New Developer
dtrinka
Posts: 3
Registered: ‎11-02-2009

Re: v4.6.0 and window.innerWidth property

The Tour (4.7.1.40 platform 4.1.0.40) also correctly excludes the banners from window.innerHeight.

 

Of the phones that concern us only the Bold includes the banners in the height calculations. Other than hard coding for the presence of the banners is there a workable solution for the Bold running 4.6? 

Please use plain text.