Created
November 6, 2017 19:09
-
-
Save kaseybon/57d6b9f1c52930af931ea9a655e9661e to your computer and use it in GitHub Desktop.
Uses modernizr to swap the file extension of an svg image if svg is not supported.
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) { | |
$('img[src*="svg"]').attr('src', function() { | |
return $(this).attr('src').replace('.svg', '.png'); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment