A site I am working on has javascript to control sound effects for the page transitions in iframes. Everything works fine in Firefox but IE displays a media player instead of the page content. Would someone be able to tell me what need to be added to the following script to stop this happening. Any help much appreciated.
In Head:
<script type="text/javascript">
function MM_controlSound(x, _sndObj, sndFile) { //v3.0
var i, method = "", sndObj = eval(_sndObj);
if (sndObj != null) {
if (navigator.appName == 'Netscape') method = "Play";
else {
if (window.MM_WMP == null) {
window.MM_WMP = false;
for(i in sndObj) if (i == "ActiveMovie") {
window.MM_WMP = true; break;
} }
if (window.MM_WMP) method = "play";
else if (sndObj.FileName) method = "run";
} }
if (method) eval(_sndObj+"."+method+"()");
else window.location = sndFile;
}
//-->
</script>
In Body:
<ul>
<li title="slide1"><a><span class="title" onclick="MM_controlSound('play','document.CS1344499390121','../Sound effects/sliding_glass_cabinet_door_open_and_close (mp3cut.net).mp3')">HOME</span></a></li>
<li title="slide2"><a><span class="title" onclick="MM_controlSound('play','document.CS1344499390121','../Sound effects/sliding_glass_cabinet_door_open_and_close (mp3cut.net).mp3')">CHOW GAR KUNG FU</span></a></li>
</ul>
<!--[if IE]>
IE Sucks, so you cannot see this content.
<![endif]--><![if !IE]><ul><li title="slide1"><a><span class="title" onclick="MM_controlSound('play','document.CS1344499390121','../Sound effects/sliding_glass_cabinet_door_open_and_close (mp3cut.net).mp3')">HOME</span></a></li><li title="slide2"><a><span class="title" onclick="MM_controlSound('play','document.CS1344499390121','../Sound effects/sliding_glass_cabinet_door_open_and_close (mp3cut.net).mp3')">CHOW GAR KUNG FU</span></a></li></ul><![endif]>
Thanks Donatello. Unfortunately this removes the whole menu in IE. I just need the media player that plays the sound to be invisible and not sure how to do that. Where would I add width="0" height="0" hidden="true". Basically the user clicks a link which moves to that page using a slider script in iframes. The sound effect also plays. The trouble is in ie the pages that appear only show the media player controller which I think overlays the actual page. Hope this makes sense.
<!--[if IE]>
Put whatever you want to be visible to IE users here.
<![endif]--><![if !IE]>
Put whatever you want to be invisible to IE users here.
<![endif]>
Experiment with it.
You can also create a separate style and put it in the head. A snippet of a style sheet that just covers the IE stuff. Make sure that it is in the right order.
Bookmarks