Skip to content

Instantly share code, notes, and snippets.

@thomasjbradley
Last active October 11, 2015 11:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thomasjbradley/3855802 to your computer and use it in GitHub Desktop.
Save thomasjbradley/3855802 to your computer and use it in GitHub Desktop.
js: svg to png
if (!Modernizr.inlinesvg) {
;(function () {
var imgs = document.getElementsByTagName('img')
, totalImgs = imgs.length
, i = 0
for (i = 0; i < totalImgs; i++) {
imgs[i].src = imgs[i].src.replace(/svg$/, 'png')
}
}())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment