PDA

View Full Version : Resolved switchmenu and videos



EMT
10-28-2010, 06:01 AM
I am using switchmenu to open and play videos and then close them and stop the video. It works great for Opera, Safari and Firefox but with IE it does not stop the video from playing when closed. How do I stop the video in IE? Any help would be greatly appreciated.

The following is the script in the head section of my page.



<script type="text/javascript">
<!--
function switchMenu(obj) {
var el = document.getElementById(obj);
if ( el.style.display != "none" ) {
el.style.display = 'none';
}
else {
el.style.display = '';
}
}
//-->
</script>


And these are in the body of my page.



<div id="wrapper">
<div style='display:none' id="pysotof">


&



<a onClick="switchMenu('pysotof');" title="Switch the Menu" style="cursor:pointer">

EMT
10-30-2010, 03:46 PM
Did I not provide enough information? Please Help!

EMT
10-30-2010, 04:55 PM
I'm thinking I can add a link with an onclick event handler that will close the menu and stop the video from playing when clicked. If so, where do I add the event handler to the following code to stop the video from playing on click?



< a onClick="switchMenu('pysotof');" title="Switch the Menu" style="cursor:pointer">


Thank You.

EMT
10-30-2010, 08:20 PM
I figured it out. I left all other code alone.

BEFORE:



< a onClick="switchMenu('pysotof');" title="Switch the Menu" style="cursor:pointer">


AFTER:



<a href="yourvidoesURL" target="iframename" title="Switch the Menu"style="cursor:pointer" onClick="switchMenu('pysotof');"><img src="URLofiimagetoclick" alt="open/close video" width="130" height="70" hspace="0" vspace="0" border="0"></a>


The Videos page must be loaded into an iframe and the video must load as autostart=false.

Works in IE, Opera, Safari and Firefox.