General Community > Scripting Help

How do I mute an iFrame?

(1/1)

Aaron10:
I have an iFrame tag on my site but every time the page loads it makes a sound which can get annoying. After some search ing apparently there is a javascript code that can mute the iFrame. Anyone know how to do this?

MrPhil:
First, I would check if there's any supported way to (via a URL switch) to turn off the noise making function. Maybe there's something like a &mute=on that's allowed?

If you can't find any kind of muting or volume command for the other site, you could try adding style="volume: silent;" to the <iframe> tag and see if that has any effect. Not all browsers will support that, and it may not work for anything but a speaking browser (i.e., not ordinary sound effects).

As you suggested in your post, maybe there's some JS code that will mute your own PC's speaker when the page containing the iframe is loaded (onload, onunload). If the noise doesn't depend on your entering the other site, but happens when the iframe is loaded, you'll probably have to put up with muting your entire page.

Please let us know what you find that works.

Navigation

[0] Message Index

Go to full version