snaggs
snaggs

Reputation: 5713

How to get actual mobile device screen size in web applications, javascript?

I write mobile application based on Cordova and I have problem with screen sizes.

When I fetch screen sizes (for Nexus 4):

var sw = screen.width;
var  sh =  screen.height;

it gives me:

width: 768; height: 1184 

However actual sizes (when I try to debug)

384 x 567

How to get actual screen size?

Thanks,

Upvotes: 0

Views: 195

Answers (1)

Subash Selvaraj
Subash Selvaraj

Reputation: 3385

Try

window.innerWidth, window.innerHeight

Upvotes: 1

Related Questions