PDA

View Full Version : Loading 2 iframes with a menu



Johank82
04-17-2005, 09:20 AM
Hi!

At my website ( http://retroid.atspace.com ) people can click on the characters and then click on inside the game pictures. If you click at Mario up left, the title screen for Super Mario Bros 1 will appear in an iframe. If you then click at the title, the story will appear in another iframe at the left side. Then click on Zelda, and both iframes will reload.

BUT, I have no clue how to apply this function to the top menu. When I have loaded the story to the left and then choose another game in the menu, the story for the other game will not dissapear.

How do I solve this problem?

Below is the menu box code on my page:

<form name="meny">
<select name="menu" style="background-color: #FFFFFF;
font size=10 ; font-family: verdana; color:#000000"
size="1" onchange="jump(this.form)">

<option value="0">Välj spel</option>
<option value="0">---------------------</option>
<option value="excitebike.htm">Excitebike</option>
<option value="gremlins2.htm">Gremlins 2</option>
<option value="icehockey.htm">Ice Hockey</option>
<option value="metroid.htm">Metroid</option>
<option value="smb1.htm">Super Mario Bros</option>
<option value="wildgunman.htm">Wild Gunman</option>
<option value="zelda1.htm" onClick="acrossFrames()">Zelda 1</option>
</select>

Thanks in advance
Johan

jscheuer1
04-17-2005, 02:33 PM
Just changing your script to this:
<script type="text/javascript">
function jump(form) {
var myindex=form.menu.selectedIndex
if (form.menu.options[myindex].value != "0")
{
window.open(form.menu.options[myindex].value,
'iframe');
window.open('iframe2-bakgrund.htm',
'iframe2');
}
}
</script>should do it.