Results 1 to 4 of 4

Thread: switchmenu and videos

  1. #1
    Join Date
    Mar 2010
    Location
    Wisconsin
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default switchmenu and videos

    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.

    Code:
    <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.

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

    Code:
    <a onClick="switchMenu('pysotof');" title="Switch the Menu" style="cursor:pointer">
    Last edited by jscheuer1; 10-28-2010 at 09:39 AM. Reason: format code

  2. #2
    Join Date
    Mar 2010
    Location
    Wisconsin
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Did I not provide enough information? Please Help!

  3. #3
    Join Date
    Mar 2010
    Location
    Wisconsin
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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?

    Code:
    < a onClick="switchMenu('pysotof');" title="Switch the Menu" style="cursor:pointer">
    Thank You.
    Last edited by EMT; 10-30-2010 at 08:27 PM.

  4. #4
    Join Date
    Mar 2010
    Location
    Wisconsin
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I figured it out. I left all other code alone.

    BEFORE:

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

    Code:
    <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.
    Last edited by EMT; 10-30-2010 at 08:42 PM. Reason: Resolved

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •