Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions

  




 

 

The JavaScript FAQ
Prev Home Next

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.

 J.S.Bach's Suite in B-minor 

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"
>&nbsp;J.S.Bach's Suite in B-minor&nbsp;</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

The JavaScript FAQ
Prev Home Next


 
 
  Mirrored with kind permission of Alexei Kourbatov Design by Interspire