Hi guys,

So I modified UBB.threads to make a sound when a mouse cursor hovers over any chosen hyperlinks and a different sound effect when it is tapped on a mobile phone or clicked with a mouse cursor.

Here is how to do it if anyone is interested in this modification.

Insert this code into your Display > General > HTML Includes > Header Insert For All Pages:

Code
<meta charset='UTF-8'>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>

Insert this code into Display > Templates > header.tpl at the very end:

Code
<!-- Audio Hover Element -->

<audio id="audioID">
  <source src="https://YourDomain.com/audio/SoundFileName.ogg" type="audio/ogg">
  <source src="https://YourDomain.com/audio/SoundFileName.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
<script>var audio1 = document.getElementById("audioID");

function playAudio() {
  audio1.play();
}</script>

<!-- Audio Clicked Element  -->

<audio id="audioID2">
  <source src="https://YourDomain.com/audio/SoundFileNameTwo.ogg" type="audio/ogg">
  <source src="https://YourDomain.com/audio/SoundFileNameTwo.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
<script>var audio2 = document.getElementById("audioID2");

function playAudio2() {
  audio2.play();
}</script>

*Change the source to your sound file locations.

Finally,

Insert this code into your hyperlink HTML code. Example:

Code
<a href="https://YourDomain.com" onmouseenter="playAudio()" onclick="audio2.play()"><b>Home</b></a>

I'm just testing how it goes with sound effects with the breadcrumbs and navigation of the forums so as to not get carried away with it.

You can try it on my forums here if you'd like. It has been tested on Google Chrome, Internet Explorer, and on my Huawei Mate Pro 20 smartphone.


[Linked Image from imagizer.imageshack.com]
[Linked Image from aliendisc.net]
[Linked Image from aliendisc.net]