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
Developer
smartek
Posts: 281
Registered: ‎05-31-2012
My Device: Playbook

how to get the device screen width and height?

how to get the device screen width and height in webworks?

Plase "+Like" my post if it was helpful.
Developer
Nitish_Pheonix
Posts: 29
Registered: ‎09-17-2012
My Device: 9810, 9800, 9700, 9900, 9300

Re: how to get the device screen width and height?

For Width: screen.width

 

For Height: screen.height

Thanks & Regards,
Nitish..

Thanks & Regards,
Nitish_Pheonix

Hit like if the above post is helpful to you.
Please Accept this as Solution if the above post is a solution for you.
BlackBerry Development Advisor
chadtatro
Posts: 620
Registered: ‎10-01-2009
My Device: Z10

Re: how to get the device screen width and height?

Hello,

 

There are a few different ways to do this, but I've always used:

 

width  = window.innerWidth;
height = window.innerHeight;

 

 

 

Chad Tetreault | App Development Consultant | BlackBerry Developer Relations | developer.blackberry.com | @chadtatro