Playing A Sound On Click

You can modify a menu so that a sound is played when a user clicks on a menu item, as in the following example (we don't think this works with browsers other than Internet Explorer for Windows):

 

Here are the steps to add a background sound when a menu item is selected:

1. Enter the following code in the Prefix field under Menu Item Settings - Condition:

if(st_nav.nam=="msie"&&st_nav.os=="win")
{
document.write("<BGSOUND VOLUME=-10000 ID=stsnd SRC='sound.wav'>"); // Sound Path Name
onblur=function()
{
document.all["stsnd"].volume=-10000;
}
}
function playandopen(u,t) // Play sound and open a link
{
if(st_nav.nam=="msie"&&st_nav.os=="win")
{
var s=document.all["stsnd"];
if(s)
{
s.volume=0;
s.src=s.src;
}
}
if(u)
void(setTimeout("open('"+u+"','"+t+"')",500));
}

Be sure to change "sound.wav" to the name of the WAV file you are using.

2. Enter the following code in the Link field under Menu Item Settings - General:

javascript:playandopen("http://www.yourdomain.com/","_self");

Be sure to change http://www.yourdomain.com/ to the desired URL.

4. Publish the menu.

5. The WAV file should be in the same directory with the .html files that include the menu.