Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Mar 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Shadowbox and Jump Menu

    I'm very much a noob, just stepping in for someone who left us in a lurch.

    I have a jump menu set up so that when a user selects an item in the jump menu it plays an swf file. I'd like for it to use shadowbox (http://www.shadowbox-js.com/) instead of replacing the page as it does now. But when I put the rel="shadowbox" line into the <option value="myswf.swf"> tag of the jump menu, it doesn't work. It still just replaces the entire page with the .swf

    Hoping someone can shed some light on what I need to do.

    This is the code at the moment:

    -------------------------------------

    <head>
    <link rel="stylesheet" type="text/css" href="shadowbox-3.0.2/shadowbox.css" />
    <script type="text/javascript" src="shadowbox-3.0.2/shadowbox.js"></script>
    <script type="text/javascript">
    Shadowbox.init({
    autoplayMovies: true,
    overlayOpacity: "0.75"
    });
    </script>

    <script type="text/javascript">
    <!--
    function MM_jumpMenu(targ,selObj,restore){ //v3.0
    eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
    if (restore) selObj.selectedIndex=0;
    }
    function MM_openBrWindow(theURL,winName,features) { //v2.0
    window.open(theURL,winName,features);
    }
    //-->
    </script>
    </head>

    <body>
    <div id="apDiv2">
    <form name="form2" id="form2">
    <select name="photosMenu" id="photosMenu" onchange="MM_jumpMenu('parent',this,1)">
    <option selected="selected">Learn how to...</option>
    <option value="Myvideo1.swf">First Video</option>
    <option value="MyVideo2.swf">Second Video</option>
    </select>
    </form>
    </div>

    ----------------------------

    So I am not sure what the code is or where I insert it in order to tell the jump menu to open the .swf in a shadowbox.

    Thanks
    MB

  • #2
    New to the CF scene
    Join Date
    Mar 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    For those interested: This is how it was advised that I make it work. And work it did.

    Change this:

    function MM_jumpMenu(targ,selObj,restore){ //v3.0
    eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
    if (restore) selObj.selectedIndex=0;
    }


    to this:

    function MM_jumpMenu(targ,selObj,restore){ //v3.0
    if (selObj.selectedIndex == 0) return;
    Shadowbox.open({
    content: selObj.options[selObj.selectedIndex].value,
    player: 'swf',
    width: 640, height: 480
    });
    if (restore) selObj.selectedIndex=0;
    }


  •  

    Posting Permissions

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