Become A Member

Home

Public Snippets

Become a Member

Privacy Policy

Terms Of Use

FAQ

SVG to PNG fallback for Images

5th February 2013

        if (!Modernizr.svg) {
    $('img[src$=".svg"]').each(function()
    {
        $(this).attr('src', $(this).attr('src').replace('.svg', '.png'));
    });
}
      

A Modernizr 'If' statement for finding all inline svg images and replacing them with PNG's for legacy browsers.

Comments

0 Comments Posted

No Comments Posted

Only Code Pad members can post comments

Become a Member

3,001

Views

25

Downloads

0

Comments

http://codepad.co/s/02aac9

Keyboard Shortcuts

DDownload

SShare

Next Snippet

Previous Snippet

Snippet has been copied to your clipboard