Created
March 23, 2012 16:54
-
-
Save rc1/2172730 to your computer and use it in GitHub Desktop.
Retina Display Image Sources
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <head> | |
| <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.min.js"></script> | |
| <script> | |
| $(function () { | |
| $("img[data-lowres]").each(function (index, el) { | |
| $(el).attr({src: (window.devicePixelRatio) ? $(el).data("highres") : $(el).data("lowres") }); | |
| }); | |
| }); | |
| </script> | |
| </head> | |
| <body> | |
| <img data-lowres="img.gif" data-highres="img_highres.gif" src="transparent.gif" /> | |
| <noscript> | |
| <img src="img.gif" /> | |
| </noscript> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment