iPhone fortune cookie

tfinch2

Lifer
Feb 3, 2004
22,114
1
0
Read the JavaScript:

if(navigator.platform.indexOf("iPhone") != -1){
isiPhone = true;
}

...

var orient = currentWidth == 320 ? "profile" : "landscape";
document.body.setAttribute("orient", orient);
if(orient == "landscape"){
crackCookie();
} else {
createCookie();
}

 

GoatMonkey

Golden Member
Feb 25, 2005
1,253
0
0
This line is pretty critical also...

setInterval(updateLayout, 1400);

So, every 1.4 seconds it will check the width of the browser window in the updateLayout function.

They have a variable called isiPhone that checks the user agent for the string "iPhone". Otherwise it would work in any browser with a width of 320px and change on any other width.