N_F_S
N_F_S

Reputation: 109

ipad 3 screen with JavaScript

What does JavaScript pull out with:

 screen.width 

and

 screen.height

on the ipad 3? Is it:

1024x768

Is there a 2048x1536 width/height?

Upvotes: 0

Views: 842

Answers (2)

Igor Escobar
Igor Escobar

Reputation: 1087

The iPad 3 resolution is 2048×1536 pixels – which is exactly twice the current iPad resolution.

That's the user agent of the iPads:

iPad:

Mozilla/5.0 (iPad; U; CPU OS 4_3 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8F190 Safari/6533.18.5

iPad2:

Mozilla/5.0 (iPad; U; CPU OS 4_3 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8F191 Safari/6533.18.5

iPad3: ??

There is a way that you can detect if the user are using an iPad device:

// For use within normal web clients 
var isiPad = navigator.userAgent.match(/iPad/i) != null;

// For use within iPad developer UIWebView
// Thanks to Andrew Hedges!
var ua = navigator.userAgent;
var isiPad = /iPad/i.test(ua) || /iPhone OS 3_1_2/i.test(ua) || /iPhone OS 3_2_2/i.test(ua);

But, i think the correct approach is create a interface based on the user resolution and not the user device. You can read more about Responsive Web Design, your visitors should love :)

Bonus There is a tool that you can test you "responsive" design in all resolutions at the same time: http://mattkersley.com/responsive/

Upvotes: 1

sgonzalez
sgonzalez

Reputation: 1086

1024x768 so that sizing is consistent across devices.

Upvotes: 1

Related Questions