- Joined
- Mar 11, 2023
- Messages
- 1
- Reaction score
- 0
How would I implement a roll over sound for each ahref in a menu.php?
<script>
var audio = new Audio('path/to/rollover-sound.mp3'); // Replace 'path/to' with the actual path to your audio file
var links = document.getElementsByTagName('a');
for (var i = 0; i < links.length; i++) {
links[i].addEventListener('mouseover', function() {
audio.play();
});
}
</script>
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.