views:

242

answers:

5

I am developing a website for Apple i* devices which uses HTML5 webkit features like transitions but I want to disable some of the fancy stuff for older/slower iPhone models like iPhone < 3GS and iPod touch < 3rd Gen because on those devices the transitions are too slow.

Is there a way to detect the exact model (not just the OS/User Agent) within Javascript?

A: 

I guess there is no existing way doing this, but you can run some code snippets to estimate the performance of the end model.

overboming
A: 

I would time the first transition and if was an unsatisfactory result, set a cookie to no longer use them.

mwilcox
The problem is, that in CSS3 you specify the duration so the transition ends in time, but it only uses 2 or 3 "in between" steps.
Thomas Rauscher
A: 

Not really answering your question but have you looked at http://www.jqtouch.com/ Might help abstract you from some of this.

Francis Shanahan
+2  A: 

This appears to work, at least to determine between 2 and 3g and 3gs... Don't know how to figure out if it is a 4g yet...

var percentmobile_t = new Date().getTime();
var percentmobile_s = 0;
while(new Date().getTime() - percentmobile_t < 20)
{
    Math.random();
    percentmobile_s++;
}
_is2_or_3g = (percentmobile_s < 1000);
Kris Erickson
While this can't pull out iPhone 4, it is an example of a way to do a sort of hidden benchmark to find out if the 3GS performance threshold is met - meets the needs it seems.
chucknelson
A: 

If it is a webapp you could use an external library like http://www.handsetdetection.com/

Revolution42
They can not distinguish between iPod Touch 1G, 2G and 3G so this doesn't help.
Thomas Rauscher