View Full Version : Making a sound when i link is clicked.
is it possible to play a sound when a link is clicked?
11-05-2002, 02:49 AM
Use the code below and it should work fine for you.
Remember to link the src="" to the sound file you want to play.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<EMBED SRC="sound file" autostart=false HIDDEN=TRUE NAME="music" MASTERSOUND>
<a href="#null" onclick="playSound();return false">PUT YOUR LINK HERE TO PLAY SOUND</a>
<input type="button" value="Stop music" onclick="music.stop()">
ADDED STOP BUTTON TO CODE
11-05-2002, 06:08 AM
Always put an 'off' button/link in your page in case your visitor doesn't like your 'wonderful' muzik/sounds. :D
11-05-2002, 07:01 AM
Amended code above with stop button!!!
11-05-2002, 09:20 PM
heres a script for onmouseover... could be easily changed to onclick, although... if the link is to another page the user will be gone before they can enjoy it...
thx a lot for your replies
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.