This is a more detailed version of my previous unanswered question: https://stackoverflow.com/questions/26076274/html-css-toggle-mute-with-picture-assignment-button
I need some help with some CSS/html5 scripting. You see, I've got this pretty cool button that mutes/unmutes audio, and the button itself toggles between two pictures (one for mute, one for unmute. You know, the basic mute/unmute speaker icons) depending on it's current state. The only problem is that I can't figure out how to make this button work. The button displays perfectly on my page and everything, and when I click on it, the picture changes like its suppose to, but my track is still playing. I already know what the problem is. You see, I don't know how to assign this button to my audio file. The audio itself has lots of attributions (autoplay, looping, display:none etc.), so I don't know quite where in my script to put it. The script for the button was found on a previous StackExhange thread (answer by Jaka Dirnbek): How to create a only mute/unmute button (like youtube) in html and the asker of this question asked only for the button, and not the audio setup, and thats where I'm stuck.
Where do i put my audio src?
In the head? or in the body? and how do i write my audio code? I currently have the following script for my audio:
<audio id="track" src="Poopsyflop.wav" loop="loop" autoplay="autoplay" div style="display:none">
¨
If anyone has any ideas, I would love to hear them :) Thanks in advance!
-Daniel
` tag and it will be fine.
– Kevin Lynch Sep 28 '14 at 19:33