2

On a wordpress mega menu, I want to show the product image on a different div when the mouse hovering a link. I work with the ubermenu plugin

I find a html+javascript code that work fine, but only when the ubermenu is implant by adding a shortcode on a page (exemple here : https://defil-communication.com/test-accueil/). The second menu work fine but the main menu don't.

Here is the code I added :

To all the product link

  <a href="https://my-product/" onmouseover="document.getElementById('image').src = 'my-image-1.jpg'">Beach Flag Crest</a>

To the div appears on fith column

 <img id="image" src="https://my-image-2.jpg" alt="image0" />

Do I have to declare the javascript somewhere ?

Thanks four your help

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
SebDfea
  • 21
  • 1

1 Answers1

0

I think you are looking for this.

How to affect other elements when a div is hovered

Javascript or jQuery is not required. Just access to the css file. You can create a div and hide it. When on hover it can unhide.

Hope this helps.