Skip to content

Instantly share code, notes, and snippets.

@anythinggraphic
Last active February 8, 2022 23:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save anythinggraphic/6d0c897d21a35d0c3db9 to your computer and use it in GitHub Desktop.
Save anythinggraphic/6d0c897d21a35d0c3db9 to your computer and use it in GitHub Desktop.
A Better Reina.js
// Alter line 50 of retina.js version 1.3.0. Instead of getting an element by it's tag name (image), we will be getting it by a class name. This helps in reducing 404 errors when there is no retina version of an image.
// Old line 50
var images = document.getElementsByTagName('img'), retinaImages = [], i, image;
// Change to this
var images = document.getElementsByClassName('has-retina'), retinaImages = [], i, image;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment