I have a set of php/html pages that contain buttons that when the mouse is over it plays a sound. Now I want that when the user clicks on another button, it silence all pages of the site or put them with sound, depending if the sound was already on or not.
I already have an html code that allows me to silence the page, but it only work on the page itself, if I go to any other page or go back to that page they have sound. And I don't want that...
This is an exemple of the code in one of the pages:
<audio preload id="sombotao">
<source src="audio/somBotao.ogg"></source>
</audio>
<a href="exemple.php"><img src="img/exemple.png" onMouseOver="document.getElementById('sombotao').play()" /></a>
I've tried using javascript, but it didn’t work. I even tried with php using sessions, but since my experience is very limited it also didn’t work.
Can anyone help me? Where can I find a piece of code as an example?
Thanks in advance. JV