• Resolved sfisher777

    (@sfisher777)


    Hello, using the plug-in works great on Chrome, Safari, iOS and FireFox for showing my SVG logo on my site … except Internet Explorer 11 where on IE 11 the SVG/logo is distorted badly. I am not much of a developer at all but if there is a medium to low level technical “fix” could you please pass along, thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Benbodhi

    (@benbodhi)

    Hi,

    Thanks for your support. I’m glad you like the plugin.
    I don’t work with internet explorer… do people still use it? ??
    I don’t actually have a computer I can test your site on to see what you need to do anytime soon. But it’s likely just a CSS issue.

    If you can’t figure it out, I’ll gladly take a look when I get access to a windows machine. In this case, I’d need a link to the page so I can see what we’re working with.

    First off : HUGE thanks to BenBodhi for the amazing plugin !

    @sfisher777 :
    This is not the plugin’s fault, it’s actually a known IE11 bug.
    Usually, IE11 will just show an SVG document at the ‘default’ size,
    which is 150px high and up to 300px wide.
    Your SVG image should not be distorted, however, unless it has some animation
    – which IE11 also can’t handle.
    The simplest fix that I’ve come up with until now, is to detect IE11 and
    have a JS assign a body class, like ‘ie11’.
    You can find a snippet here

    Actually, here it is : it’s just a short piece of jQuery.

    jQuery(window).load(function() {
          if(navigator.userAgent.match(/Trident.*rv:11\./)) {
             jQuery('body').addClass('ie11');
         }

    You need to add this to your theme’s ‘main’ js, and I can’t help you there, because this varies from theme to theme.

    Then, in the theme’s stylesheet, you need to add some CSS that will only target the ‘offending’ instances of your images, and the offending browser ( IE11 ), and give them a height that you need them to render at ( if the height is not declared, IE11 will just default to 150px ).
    Your CSS should look something like this :

    body.ie11 .your-class { 
       height: 400px;
       width: 100%;
       }

    You can play with the height until you get the size you need.
    If this doesn’t fix your issue, and your image is ‘badly distorted’ – and it’s not because of an embedded animation, you may have some other things going on.

    Hope this helps.

    Cheers,

    Greg

    Plugin Author Benbodhi

    (@benbodhi)

    Hi @greg-d1,

    Thanks for taking the time to leave some really helpful instructions! I have been adding and fixing features of the plugin lately, so I’ll test this and see if I can get something in the next version. If I don’t, at least this is here. Thanks so much ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘SVG Image Not Showing Correctly on IE11’ is closed to new replies.