In general, a button on a Web page does not have a sound triggering event. If you want the button to sound in response to the mouse action, we can write a section of JavaScript script code to implement it.
Can let the button to make a sound script, this does not have to make flash button also can, I try to feel good.
Production method:
1. New file:
Dynamicaudiobutton.js, Code:
Customize Dynamic Audio Link custom dynamically sound links
function Dynamicaudiolink () {
Open ("http://www.pcedu.com.cn")
}
Customize dynamic Audio Mouse over color custom animated sound mouseover color
function Audioover () {
Document. Audio.button.style.background= "#999999"
Document. Audio.button.style.color= "White"
}
Customize dynamic Audio Mouse down color custom animated sound MouseDown color
function Audiodown () {
Document. Audio.button.style.color= "#cccccc"
}
Customize dynamic Audio Mouse off color custom animated sound Mouseoff color
function Audioout () {
Document. Audio.button.style.background= "#666666"
Document. Audio.button.style.color= "#ffffff"
}
Customize Dynamic Audio Sound Custom animated sound
function Playhome ()
{
DOCUMENT.ALL.SOUND.SRC = "Bleep.wav";
}
document.write (' <bgsound id= ' sound ">")
Customize button Style custom buttons
document.write (' <style type= "text/css" > ' + ' <!--')
document.write ('. Select{background: #666666; Border-color: "#999999"; color: "#ffffff"; Font-family:arial,helvetica, Verdana;font-size:10pt;font-weight:bold;} ' + '--> ' + ' </STYLE> ')
document.write (' <center><form name=audio><input class= "Select Name=button type=" button "value=" Dynamic
Audio "onclick=" Dynamicaudiolink () "onmouseover=" Audioover ();p layhome () "onmousedown=" Audio
Down () "onmouseout=" Audioout () "></form></center>")
2. After you save the file, insert code to refer to the JS file in the page related department:
<script language= "JavaScript" src= "Dynamicaudiobutton.js" ></script>
3, choose good music files, can be WAV, MP3, music files as small as possible.
Method is finished, the user can use the form of picture and so on, the corresponding code of the Dynamicaudiobutton.js file must also be modified.