Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Play sound onMouseover

Status
Not open for further replies.

greelmo

Programmer
May 16, 2003
89
US
i want to have a staticy sound play when the mouse goes over a link. so far i have this... can you tell me where i'm going wrong?

<SCRIPT LANGUAGE=&quot;JavaScript&quot;>
function fncsfx(mySound)
{
document.getElementById('mysfx').src=mySound;
}
function stopme()
{
document.getElementById('mysfx').src=&quot;&quot;;
}
</script>

and the HTML

<div class=&quot;menua&quot;><a href=&quot;home.html&quot; onMouseover=&quot;fncsfx(' onMouseout=&quot;stopme();&quot;>Home</a></div>
<embed src=&quot;song.mp3&quot; autostart=true hidden=true loop=infinite>
<embed id=&quot;mysfx&quot; autostart=true hidden=true></embed>

here are my questions... i want both things to play infinitely... the first embed is background music... the second is the sound effect.
1)How do I make the sound effect play onMouseover!?
2)How do I make both things play inifinitly?
3)Is there a more practicle way to do this?

Later,
Greelmo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top