javascript| button
Article Introduction:
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 (' ' + ' ' + ' ')
document.write ('
")
2. After you save the file, insert code to refer to the JS file in the page related department:
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.