Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

devicePixelRatio #4

Open
oemueller opened this issue Nov 5, 2014 · 0 comments
Open

devicePixelRatio #4

oemueller opened this issue Nov 5, 2014 · 0 comments

Comments

@oemueller
Copy link

wouldn't it be neat to have the script load @2x retina images if the device supports it?
Like adding a class member:
this.retina = (window.devicePixelRatio && window.devicePixelRatio > 1);

and replacing the image URL if we need double sizes?
if (this.retina) img = img.replace(/.{1}\w{3,4}$/g,'@2x$&');

The reason I come up with this, is because Gumbys Retina Plugin does not work on top of ResponsiveImages. At least for me.

Oliver

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant