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: 60
Registered: ‎01-16-2009
My Device: Not Specified

Blackberry Bold : Get Browser Height and Width

How to get the Browser Height and Width in Blackberry Bold through java script?

 

Thanks,

Navaneeth

Developer
Posts: 189
Registered: ‎08-13-2008
My Device: Not Specified

Re: Blackberry Bold : Get Browser Height and Width

Hello

 

Have you tried 

screen.availWidth

screen.availHeight

 

 These are the properties of the screen object.

 

availHeight int Returns the height of the BlackBerry device screen that is available to the BlackBerry®
Browser, in pixels. This may be equal to or less than the value of Screen.height.
read only


availLeft int Returns the screen space available to the left of the browser window. In the case of the
BlackBerry Browser, this property always returns a value of “0”.
read only


availTop int Returns the screen space available above the browser window. In the case of the
BlackBerry Browser, this property always returns a value of “0”.
read only


availWidth int Returns the width of the BlackBerry device screen that is available to the BlackBerry
Browser, in pixels. This may be equal to or less than the value of Screen.width.
read only


colorDepth int Returns the bit depth of the color palette. This property behaves identically to the
pixelDepth property.
read only


height int Returns the height of the BlackBerry device screen, in pixels. read only


pixelDepth int Returns the color resolution, in bits per pixel, of the display. read only


width int Returns the width of the BlackBerry device screen, in pixels. read only

 

Cheers

 

Andrew

Highlighted
New Developer
Posts: 4
Registered: ‎07-08-2009
My Device: Not Specified

Re: Blackberry Bold : Get Browser Height and Width

Hi I am trying to get this working exactly how you have recomended but the script is crashing.

have you tryed to use it?

document.write("resWidth: " + screen.availWidth + " resHeight:" + screen.availHeight);

 

thanks.

New Developer
Posts: 4
Registered: ‎07-08-2009
My Device: Not Specified

Re: Blackberry Bold : Get Browser Height and Width

Actually never mind I just got it . It works
New Developer
Posts: 13
Registered: ‎01-03-2009
My Device: Not Specified

Re: Blackberry Bold : Get Browser Height and Width

Another way is window.innerWidth.  You can put alert(window.innerWidth) in a javascript function and it will display the width in a pop up so you can verify it's working as you expect.