Adaptive-Images icon indicating copy to clipboard operation
Adaptive-Images copied to clipboard

Improved JavaScript for cookie-dealing with high-ppi devices.

Open Darkwing371 opened this issue 12 years ago • 0 comments

As I reported in https://github.com/MattWilcox/Adaptive-Images/issues/115, I see a problem in using screen.width alone as a source for doing the math, when it comes to high-ppi devices.

It seems I now figured out a highly reliabe way to detect the actual screen size of a display – meaning especially the high-ppi screens on mobiles like smartphones and tablets.

Have a look: https://github.com/Darkwing371/Adaptive-Images-Uber-Extended/tree/ai-cookie-snippet.js

Read the readme, check code and comments and feel free to comment/contribute for improvements and suggestions!

And most of all: use it, if you think it’s a good idea! :)


Note: since this is my first pull request ever, I hope everything went ok with it so far … ;)

Darkwing371 avatar Apr 24 '13 21:04 Darkwing371