Results 1 to 2 of 2

Thread: Loading 2 iframes with a menu

  1. #1
    Join Date
    Apr 2005
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Loading 2 iframes with a menu

    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

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Just changing your script to this:
    Code:
    <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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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
  •