![]() |
Javascripts |
|
Javascript; Play Sound Files on Mouseover of LinkThere
are 2 ways to play sound on mouseover. This first way seems to be more reliable
than the javascript version Sitemap Run your mouse over the links for an example! STEP 1 Place this first part of the script into the body (content) of your page which preloads the sound files. Substitute the sound files for your own, below the fifth line. The first sound file will be 0, the second 1, the third 2 and so on. You can add as many different sound files as you have links. STEP 2 Simply add this code into each link, changing the number of the mouseover event to correspond to your sound file. onMouseOver="playSound(0)" onMouseOut="stopSound(0)" Your
link code should look like this; Want
to play music on mouseover of an image or object? The
first part of the javascript will be the same. The html code on the image or object
will be similar to this: Have fun!
|
|