Site logo

Archived topic

No Sound on Hover with Hook Element

5 replies · Started by HansRuedi on June 3, 2022

Viewing posts 1–6 of 6

Hi there,

Please have a look at…
https://schwarzaufweiss.ch/kunden/

My little wolf is here, but that mp3 doesn't play on hover…

.partner-link {
    display: block;
    position: fixed;
    left: 90%;
    top: 90%;
    right: 0;
    bottom: 0;
    z-index: 1;
    background-repeat: no-repeat;
    background-size: contain;
}

…what's wrong with my Hook element what I have in wp_head for that page?

<div class="hide-on-mobile">
<div class="partner-link">
	<a href="https://www.wolfensberger-ag.ch" target="_blank"><img src="https://schwarzaufweiss.ch/wp-content/uploads/2022/05/cropped-wolfplakat_icon-3.png" width="45%" height="45%" ></a>
</div>
</div>
<script>
var audio = document.getElementById("https://schwarzaufweiss.ch/wp-content/uploads/2022/06/wolf.mp3");
$("nav a").mouseenter(function() {
  audio.play();
});
</script>

Thanks for a tip!
Hans

Hi there,

Sorry not sure if I fully understand.

Are you thinking that GP is somehow causing a conflict here?

Are you sure the <script> you've added is actually doing what is supposed to do?

Hi Leo,

no conflict, but yes I'm not sure if that script is right…

That's why I'm asking.

Unfortunately we cannot help with custom scripts/solutions in the forum here:
https://generatepress.com/what-support-includes/

I would recommend checking with the author of the script to make sure you are adding everything correctly.

Thanks for your understanding :)

ok, thanks!

No problem :)

This archived topic is closed to new replies.