Skip to content

Instantly share code, notes, and snippets.

@almonk
Last active December 14, 2015 08:19
Show Gist options
  • Save almonk/5056945 to your computer and use it in GitHub Desktop.
Save almonk/5056945 to your computer and use it in GitHub Desktop.
<img src="logo.svg" width="200" height="300">
<img src="logo.svg" data-png-fallback="logo.png"
width="200" height="300">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script>
<script>
$(function(){
if(!Modernizr.svg) {
$('[data-png-fallback]').each(function() {
$(this).attr('src', $(this).data('png-fallback'));
});
}
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment