...

View Full Version : mouseOver sound in firefox



many_tentacles
05-27-2006, 03:42 PM
hi

i have the following code which works fine in IE but nothing happens in firefox.


<html>
<bgsound id="sound">
<script>
function PlaySound(url) {
document.all.sound.src = url;
}
</script>

<body>

<a href="#"><img src="images/butters.jpg" onMouseOver="PlaySound('http://www.pacdv.com/sounds/sounds/sound38.mp3')" /></a>
</body>
</html>

Any one know of any good ways to make sound work in firefox?

ta

Arty Effem
05-28-2006, 04:57 AM
hi

i have the following code which works fine in IE but nothing happens in firefox.


<html>
<bgsound id="sound">
<script>
function PlaySound(url) {
document.all.sound.src = url;
}
</script>

<body>

<a href="#"><img src="images/butters.jpg" onMouseOver="PlaySound('http://www.pacdv.com/sounds/sounds/sound38.mp3')" /></a>
</body>
</html>

Any one know of any good ways to make sound work in firefox?

taTry the code demonstrated here. It isn't widely tested yet, but may be of use:
http://www.hotspot.freeserve.co.uk/ttdemo/

flashbang_pro
05-11-2011, 03:28 AM
I have tried this link and the mouse over sounds do not work in FireFox 4.

I am developing a haunted forest web site and the client wants a scream.wav when the user hovers over a link. I have searched and searched and found nothing to make it work in FireFox.

All help is greatly appreciated.

Thanks

AndrewGSW
05-11-2011, 01:03 PM
'bgsound' is for IE only. Add an empty span to your page and then use the mouse-over to insert an embed-ded sound file to this span. The script should be within the <head> tag of your page:


<script type="text/javascript">
function PlaySound(url) {
document.getElementById("sound").innerHTML="<embed src=\""+url+"\" hidden=\"true\" autostart=\"true\" loop=\"false\" />";
}
</script>

// and the HTML:

<body>
<span id="sound"></span>
<a href="#"><img src="images/butters.jpg" onMouseOver="PlaySound('http://www.pacdv.com/sounds/sounds/sound38.mp3')" /></a>

</body>If it doesn't work it may be because you're using an mp3 file. Try it first with a simpler .wav file. Otherwise, you may need to confiugure FF to play mp3 files.

Added: Yeah, works for me in IE, FF and Chrome :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum