Music on/off...

G

Guest

I added backround music but was thinking that it might be annoying to some
users and want to add a play/stop switch. Is it possible to do this through
the background sound feature, or do i need to completly change the set up. If
so, exactly how do i go about do so?
 
T

Trevor L.

FrontPageUser said:
I added backround music but was thinking that it might be annoying to
some users and want to add a play/stop switch. Is it possible to do
this through the background sound feature, or do i need to completly
change the set up. If so, exactly how do i go about do so?

Nah, it is quite simple

I put this in my HTML
<span id="sound"></span>
<input type="button" value="Play/Stop
Music" onclick="playSound()"/>

The function is
function playSound()
{
var x = document.getElementById("sound")
x.innerHTML = (!x.innerHTML )
? '<embed src="audio/minuet.mid" loop="false" autostart="true"
hidden="hidden">'
: ' '
}
 
G

Guest

I added this code. Got the button, but the following shows up on the website
along with the button:

where function playSound(fname) { if (!fname) fname = "audio/minuet.mid" var
x = document.getElementById("sound") x.innerHTML = (!x.innerHTML ) ? '' : ''
}

Went on and uploaded it onto the site to see if the button would work anyway
... it didn't.

What am I doing wrong?

Thanks.
 
G

Guest

Thank you Paul. I have to leave the computer for the day, but will give it a
try tomorrow. Thanks so much for your help.

Tami
 

Ask a Question

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.

Ask a Question

Top