...

View Full Version : Shadowbox and Jump Menu



bauerm
03-01-2011, 10:49 PM
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

bauerm
03-04-2011, 03:31 PM
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;
}



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum