Playing Sound onMouseOver
Question: Can I play a sound onMouseOver?
Answer:
Yes, you can call a sound playback function
from the
onMouseOver
event handler of a hyperlink. Try this example: place
your mouse pointer over the following hyperlink,
and the browser will start the playback.
Here's the source code for this hyperlink:
<a href=#
class=playOnHover
title="This hyperlink plays a sound onMouseOver."
onClick="return false"
onMouseOver="playSound();return true"
onMouseOut ="stopSound();return true"
> J.S.Bach's Suite in B-minor </a>
The source code of the functions
playSound()
and
stopSound()
can be found in the
Playing Sound section.
JavaScripter.net.
Copyright
© 1999-2006, Alexei Kourbatov