fasisi
fasisi

Reputation: 396

Javascript window.width and mobile display specification

I have a smartphone with display specification as 720x1280. But, when I make a sample webpage and add javascript

window.width

I get 340.

Why is that?

Upvotes: 0

Views: 48

Answers (1)

Lakmal Caldera
Lakmal Caldera

Reputation: 1031

you should probably look into ur view port, try adding this

<meta name=”viewport” content=”width=device-width; initial-scale=1.0; maximum-scale=1.0; user-    scalable=0;” />

that will ensure that ur document is will fill the device screen, essentially make one ccs pixel equal to one device pixel

Upvotes: 1

Related Questions