From 1153924a71f98db25fe81e501d929d8393259ff4 Mon Sep 17 00:00:00 2001 From: Matt Wilcox Date: Thu, 10 Nov 2011 10:21:18 +0000 Subject: [PATCH] Added option for supporting Retina and other high density devices by using an alternative JS snippet. (Thanks to Fabian Michael) --- instructions.htm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/instructions.htm b/instructions.htm index cba8e0a..999ef99 100644 --- a/instructions.htm +++ b/instructions.htm @@ -25,7 +25,10 @@

Basic instructions

Copy the following Javascript into the <head> of your site. It MUST go in the head because it needs to work before the page has finished loading, and before any images have been requested.

<script>document.cookie='resolution='+Math.max(screen.width,screen.height)+'; path=/';</script>

That's it, you're done.

-

NOTE: you do not need the ai-cookie.php file unless you are using the alternate method of detecting the users screen size. So delete it if you like, no one likes mess.

+

NOTE 1: if you would like to take advantage of high-pixel density devices such as the iPhone4's Retina display you can use the following JavaScript instead. + It will send higher-resolution images to such devices - be aware this will mean slower downloads for users.

+
<script>document.cookie='resolution='+(Math.max(screen.width,screen.height)*("devicePixelRatio" in window ? devicePixelRatio : 1))+'; path=/';</script>
+

NOTE 2: you do not need the ai-cookie.php file unless you are using the alternate method of detecting the users screen size. So delete it if you like, no one likes mess.

You already have a .htaccess file

I strongly advise you to duplicate that file so you can revert to it if things go pear-shaped.