Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

Javascript to turn off background sound.



9:29 pm on Dec 10, 2002 (gmt 0)

10+ Year Member

Does anyone know of a way of providing visitors to my home page with an option to turn off the background sound? The sound file I'm using is a .wav - something like an on/off button or a clickable link would be nice :-)



11:26 pm on Dec 10, 2002 (gmt 0)

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

It's a bit more complex than you might think. Here's one discussion, with some code examples:
javascripter.net [javascripter.net]

Also, here's a column with some good food for thought about background sound controls:
HTML Goodies [htmlgoodies.com]

I haven't programmed any background sound for years, even on musician's sites - it just doesn't seem user friendly to me.


11:48 pm on Dec 10, 2002 (gmt 0)

10+ Year Member

I absolutely agree; the background sound slows down the page loading even though it's compressed as much as possible, apart from everything else. Every so often I try and sneak it off but get deluged with e-mails and postings on my site's bulletin board asking me to put it back.

Anyway, thanks for the links; I've copied some Javascript for an on/off button from one of them :-)


11:56 pm on Dec 10, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

Eh, if all else fails there's still the old 'Esc' button. Works for me.



12:49 am on Dec 11, 2002 (gmt 0)

10+ Year Member

Yet another use for Flash, you can give full control over the sound (start, stop, pause, etc) and it will stream. Best part is that the music is in mp3 format.

Featured Threads

Hot Threads This Week

Hot Threads This Month