Created
September 21, 2015 20:16
-
-
Save nola/34ee5a53cb05a23b49f1 to your computer and use it in GitHub Desktop.
This file contains 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
if (!Modernizr.svg) { | |
var imgs = document.getElementsByTagName('img'); | |
var svgExtension = /.*\.svg$/ | |
var l = imgs.length; | |
for(var i = 0; i < l; i++) { | |
if(imgs[i].src.match(svgExtension)) { | |
imgs[i].src = imgs[i].src.slice(0, -3) + 'png'; | |
//console.log(imgs[i].src); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment