Viewing 3 replies - 1 through 3 (of 3 total)
  • What plugin (or code) are you using for that imagemap mouseover? It’s likely that the JavaScript flips the image based on the ID of the image, which will cause issues because then hovering over the sticky image will result in changing the original (invisible) image.

    Thread Starter mausheld

    (@mausheld)

    I use the Plugin “Post Snippet” to hold the Code and paste the Shortcode on the Page.

    This is the Code:

    <script type="text/javascript">
          function ReplaceImage(filename)
          {
            document.getElementById("imagemap").src = filename;
          }
          function ReplaceImageBack()
          {
            document.getElementById("imagemap").src = 'https://cremoninsel.de/wp-content/uploads/2015/06/lageplan.png';
          }
    
        </script>

    I use this in the image map:

    <area shape="rect" coords="100,152,135,182" href="https://cremoninsel.de/mietpreise/haus-7/#m" onmouseover="ReplaceImage('https://cremoninsel.de/wp-content/uploads/2015/06/lageplan7.png')" onmouseout="ReplaceImageBack()">

    If it’s a custom function that you wrote yourself, I would suggest to not check the image by ID, but by CLASS instead.

    Give the image a classname of “imagemap” (instead of an ID) and then use the function document.getElementsByClassName (instead of document.getElementsById).

    Once that works, it should make the plugin work as well.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Imagemap Mouseover not working when sticky’ is closed to new replies.