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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
New Developer
Posts: 10
Registered: ‎08-22-2008
My Device: Not Specified

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

 

BlackBerry Development Advisor
Posts: 15,887
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
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.
New Developer
Posts: 10
Registered: ‎08-22-2008
My Device: Not Specified

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.

BlackBerry Development Advisor
Posts: 15,887
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
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.
Highlighted
New Developer
Posts: 3
Registered: ‎11-02-2009
My Device: Not Specified

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.

 

New Developer
Posts: 3
Registered: ‎11-02-2009
My Device: Not Specified

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.


New Developer
Posts: 3
Registered: ‎11-02-2009
My Device: Not Specified

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?