logo

Javascripts
Play Sounds on Mouseover of Link
Music on Mouseover of Image

Google
Web Search Hypergurl.com



Handy Tip : Making music play or giving sound as your cursor pointer runs over a link is a good effect for a web page. Keep the sound files short so your visitor gets the effect, as large files take longer to download and your visitor could miss what you are trying to achieve.


Bookmark This Page

Javascript; Play Sound Files on Mouseover of Link

There are 2 ways to play sound on mouseover. This first way seems to be more reliable than the javascript version

This is a great javascript which allows you to play different sounds as your visitors runs their mouse over each link or music on mouseover of an image.

Sitemap Run your mouse over the links for an example!

Java Scripts

Paint Shop Pro Tutorials

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;

<a href="http://www.yourlink.com" onMouseOver="playSound(0)" onMouseOut="stopSound(0)">YOUR LINK</a>

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:

<img src="yourimage.gif" onMouseOver="playSound(3)" onMouseOut="stopSound(3)">

Have fun!

 
Hypergurl Hosting
IMPROVED PLANS
FREE Domain Name
web hosting and domain registration

 
Hosting Log In
Username:
Password: Sign up
NEW!
Blog for Webmasters

web site design feed Website Design

 
Refer A Friend
Your Email
Your Name
Friends Email
Friends Name





Site design copyright 2001-2006 © hypergurl.com