• Resolved mattystrya

    (@mattystrya)


    Hi,

    I’m trying to embed the following SVG into WordPress, specifically in Divi: https://dagsonline.org/delete/FINAL2.svg

    I have used the Divi code module.

    It mostly works but the Javescript doesn’t seem to work. The Javascript should change the text at the top of the SVG when hovering over parts of the image.

    I’m not amazing at this kind of thing, and I’ve literally spent about 40hrs trying to get this to work for free for a green environmental project. Help really really appreciated, thank you in advance,

    Matthew

    The page I need help with: [log in to see the link]

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

    (@benbodhi)

    Hi there,

    Cool SVG ??

    Sounds like you’ve almost got it.

    I see an error in the console related to your javascript:

    Uncaught ReferenceError: displayName is not defined
        at SVGPathElement.onmouseover (<anonymous>:2:1)

    I would usually separate the javascript (and CSS) out from the SVG file and enqueue it alone in your child theme or a plugin. That may just do the trick.

    Let me know how you go.

    Thread Starter mattystrya

    (@mattystrya)

    Hello again,

    Thanks so much for your help, your suggestion fixed my SVG straight away!

    I moved the javascript out of the SVG.

    The website is still a work in progress as I write, and I still have to complete the mobile versions, but it looks great on desktop without much more to do: https://dagsonline.org/

    Thanks again, great plugin!

    Matthew

    Plugin Author Benbodhi

    (@benbodhi)

    Thanks for letting me know! I’m glad you got it sorted ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘SVG Works fine in borwser but not WP or Divi’ is closed to new replies.