View Full Version : Play sound on hover without using Javascripting?

02-03-2005, 09:24 PM
I'd like to play a sound file whenever a mouse hovers over a hyperlink or image link, but without using Javascripts. I've seen different ways of doing this, but inconsistent results from others. The Web site (myspace.com) that I'd like to insert this does not support Javascripts, but does allow standard HTML and CSS. Thanks everyone! :cool:

02-03-2005, 10:04 PM
sorry thats impossible...

Basic law of webcoding: XHTML for content, CSS for presentation, javascript for action. You are attempting an action, this is what javascript is required and used for. I don't understand how your website could disallow javascript unless they weren't allowing rich HTML. My opinion of sites like myspace are not too high...but oh well.

02-03-2005, 10:50 PM
Its pretty hard to not allow inline javascript; are they just not allowing .js files? Usually if you put the script in the HTML page and not in a seperate .js file there is no way the server will block it.

02-06-2005, 05:49 AM
Try using <script< if it doesn't allow :thumbsup: It's practically unethical and immoral to try to block the use of javascript.

And yes, there are scripts that do block out javascripts.... it just doesn't render what ever's between the <script> and </script> tags.

So try using wot i mentioned above and see if there is a difference :D

02-06-2005, 10:20 PM
yes you can do that and its simple just use flash.

02-06-2005, 11:32 PM
You might try something like

a:hover::before {
content: url(mysound.wav);

You are supposed to be able to insert audio into webpages using the content property... maybe that will do something. I would only expect a result in Opera, however.

02-06-2005, 11:36 PM
Sound and the web doesn't really marry... There's no natural sound interface for the web around - either you have only wav/au files, or you need a plug-in or Java. Anyway, the way that works best (biggest number of users) is to use a Flash control for sound, if your host allows that.