Hello everyone! This community has been absolutely great to me. I am here again with another question! I have a script that follows as such: mouse over images, also when clicked displays a pop up window. Now I need to have it not only roll over to my other image, but play a sound file/click as well. Here is the code I have
<input name="image" type="image" onMouseOver= src="http://japanesefriend.zxq.net/images/pk1pg1roll_15.jpg" onMouseOut= src="http://japanesefriend.zxq.net/images/pk1pg1_15.jpg" value="" src="http://japanesefriend.zxq.net/images/pk1pg1_15.jpg" onClick='styledPopupOpen("<img src=http://japanesefriend.zxq.net/flashcards/ichi.gif />")' align=middle width=131 height=118>
I greatly appreciate any assistance and time you put into this for me!
Place the following script in the <head> of your HTML document:
The last thing you need to add is an element that you want to generate the sound on click or on mouseover. Call the script with one of those attributes:
<a href=“#” onclick=“playSound(‘URL to soundfile’);”>Click here to hear a sound</a>
<p onmouseover=“playSound(‘URL to soundfile’);”>Mouse over this text to hear a sound</p>
Source: webdesign about