How to play audio clip on mouseover?
June 26, 2004 6:14 AM   Subscribe

Web tricks. This rather clever use of the "marquee" html tag made me wonder how I could code a really stupid and irritating effect : mousing over a link triggers a tiny, obnoxious audio clip.

" isn't there some way I could make a tiny little (2-3 sec) audio clip play when somebody mouses over a link?....Farts, shrieks, high pitched cartoon voices wailing "It's hopeless. I'll just crawl up my ass and die!", and so on."
posted by troutfishing to Computers & Internet (6 answers total)
 
We could tell you, but then we'd have to kill you for possessing such dangerous knowledge, lest you use it unwisely....
posted by anastasiav at 8:20 AM on June 26, 2004


You could, I suppose, have a "hidden" frame on your page. Use javascript to load your sound clip in the hidden frame, like so:

<a href="your_link.html" onMouseOver="hiddenFrame.location='scream.mp3'">Text</a>
posted by mkultra at 8:51 AM on June 26, 2004


Flash would work. You might want to download the trial of Dreamweaver from Macromedia. They have some sort of dealie built in to automate the creation of exactly this type of annoyance.
posted by cedar at 9:25 AM on June 26, 2004


I found this evil code that I wrote a while ago:

<embed name="sound" src="sound.wav" loop="false" autostart="false" hidden="true">

<a href="http://www.website.com" onmouseover="javascript:self.document.sound.play();" onmouseout="javascript:self.document.sound.stop();">link</a>

IE-only, I think, although it might work in Netscape 4 or something too.
posted by reklaw at 9:50 AM on June 26, 2004


You could have a transparent DHTML layer appear on-mouseover, and the layer could contain an HTML file embedded with audio. Convoluted? Yes. Might work, though ;)
posted by dhoyt at 1:30 PM on June 26, 2004


One way and one other way.
posted by iconomy at 12:20 PM on June 27, 2004


« Older Is my iPod dead?   |   South Jersey Newer »
This thread is closed to new comments.