• Resolved WP Inventory

    (@chuck1982)


    Hi Daryll!

    I love the plugin. Really good work! I am having trouble with one thing though. That is, the designer sent me an SVG with a hover effect. It does some movement and drawing of sections on like 5 second loop. Problem is, the icon does not have the hover effect once I upload it via the WP dashboard and use it from the media manager. I wrote a really fast function to make sure I was not crazy and that the SVG DID have an animation like so:

    class ThemeSVG {

    function sponsorship_activation_icon() {
    $path = TEMPLATE_URL . ‘/images/svg/sponsorship-activation-icon.svg’;
    $image = file_get_contents( $path );

    return $image;
    }

    }

    $icons = new ThemeSVG();
    $icons->sponsorship_activation_icon();

    The result is that the icon did have a hover and I was not crazy ??

    So, the conclusion is that once I upload it to the media manager, it looses that hover state.

    Does the premium version keep the hover effects? Or, do you have a solution at hand?

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Daryll Doyle

    (@enshrined)

    Hi @chuck1982,

    Nope, you’re not crazy ??

    The sanitiser currently strips nearly all JavaScript out of the SVG, as it can’t be sure if this is secure or not (JS is very easy to obfuscate which means we don’t know if it’s safe until runtime).

    If the animations are triggered with CSS then this is something I can look at. Otherwise if it’s JS, then it’s a bit harder. If you can send me over the SVG I’ll be happy to take a look for you. Either on here or to [email protected].

    Cheers,
    Daryll

    Plugin Contributor Daryll Doyle

    (@enshrined)

    Resolved over email:

    SVGs were being used inside img tags rather than inline causing :hover css not to work.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Animated SVG on hover’ is closed to new replies.