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 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jul 2006
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Changing two iframes at once - problems

    Greetings,

    I'm trying to change two iframes at once, when the user clicks on one link. I'm working in Dreamweaver MX on a mac. The script initially works, but after acouple clicks it seems to go buggy and will only change iframe1 and not iframe2. Also, the script won't work at all unless I define the iframes with an initial scr. (It won't let me use "" as the initial scr, so I'm using blank.jpg which is an image of a white colored pixel.) Any help will be appreciated. Thanks.

    <code>

    <table width="780" border="0" cellpadding="0" cellspacing="0">
    <tr>
    <td width="106" rowspan="2"><img src="../Sbrush.jpg" width="101" height="480" /></td>
    <td width="224" rowspan="2"><span class="style4">Brochures<br />
    Please select a Title</span>
    <ul>
    <li><a href="javascript:void(0)" onClick="parent.iframe2.location='../blank2.jpg';parent.iframe1.location='JPGs/PelicanV3.jpg';return false">Pelican's Nest</a></li>
    <li><a href="javascript:void(0)" onClick="parent.iframe2.location='TextR.htm';parent.iframe1.location='JPGs/RavenV4.jpg';return false">Ravenwood</a></li>
    <li><a href="javascript:void(0)" onClick="parent.iframe1.location='JPGs/CampBayView.jpg';parent.iframe2.location='../blank.jpg';return false">YMCA Camp Bay View</a></li>
    <li><a href="javascript:void(0)" onClick="parent.iframe1.location='JPGs/CampCory.jpg';parent.iframe2.location='../blank.jpg';return false">YMCA Camp Cory</a></li>
    <li><a href="javascript:void(0)" onClick="parent.iframe1.location='JPGs/CampGorham.jpg';parent.iframe2.location='../blank.jpg';return false">YMCA Camp Gorham</a></li>
    <li><a href="javascript:void(0)" onClick="parent.iframe1.location='JPGs/CampMonroe.jpg';parent.iframe2.location='../blank.jpg';return false">YMCA Camp Monroe</a></li>
    </ul>
    </td>
    <td width="450" height="400"><iframe src="../blank.jpg" name="iframe1" width="450" marginwidth="0" height="420" marginheight="0" align="top" scrolling="Auto" frameborder="0" id="iframe1"><!-- iframe1 --></iframe>
    <p>&nbsp; </p>
    </td>
    </tr>
    <tr>
    <td><iframe src="../blank.jpg" name="iframe2" width="300" marginwidth="0" height="40" marginheight="0" align="left" scrolling="No" frameborder="0" id="iframe2">
    <!-- iframe2 -->
    </iframe></td>
    </tr>
    </table>
    </code>

  • #2
    Senior Coder
    Join Date
    Mar 2005
    Location
    Portsmouth UK
    Posts
    4,466
    Thanks
    3
    Thanked 495 Times in 482 Posts
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    
    <html>
    
    <head>
    <title></title>
    </head>
    
    <body>
    <table width="780" border="0" cellpadding="0" cellspacing="0">
    <tr>
    <td width="106" rowspan="2"><img src="../Sbrush.jpg" width="101" height="480" /></td>
    <td width="224" rowspan="2"><span class="style4">Brochures<br />
    Please select a Title</span>
    <ul>
    <li><a href="javascript:void(0)" onClick="document.getElementById('iframe2').src='http://www.vicsjavascripts.org.uk/StdImages/One.gif';document.getElementById('iframe1').src='http://www.vicsjavascripts.org.uk/StdImages/Two.gif';return false">Pelican's Nest</a></li>
    <li><a href="javascript:void(0)" onClick="document.getElementById('iframe2').src='http://www.vicsjavascripts.org.uk/StdImages/Three.gif';document.getElementById('iframe1').src='http://www.vicsjavascripts.org.uk/StdImages/Four.gif';return false">Pelican's Nest</a></li>
    <li><a href="javascript:void(0)" onClick="document.getElementById('iframe2').src='http://www.vicsjavascripts.org.uk/StdImages/Five.gif';document.getElementById('iframe1').src='http://www.vicsjavascripts.org.uk/StdImages/Six.gif';return false">Pelican's Nest</a></li>
    <li><a href="javascript:void(0)" onClick="document.getElementById('iframe2').src='http://www.vicsjavascripts.org.uk/StdImages/Seven.gif';document.getElementById('iframe1').src='http://www.vicsjavascripts.org.uk/StdImages/Seven.gif';return false">Pelican's Nest</a></li>
    </ul>
    </td>
    <td width="450" height="400">
    <iframe src="../blank.jpg" id="iframe1" name="iframe1" width="450" marginwidth="0" height="420" marginheight="0" align="top" scrolling="Auto" frameborder="0" id="iframe1"><!-- iframe1 --></iframe>
    <p>&nbsp; </p>
    </td>
    </tr>
    <tr>
    <td><iframe src="../blank.jpg" id="iframe2" name="iframe2" width="300" marginwidth="0" height="40" marginheight="0" align="left" scrolling="No" frameborder="0" id="iframe2">
    <!-- iframe2 -->
    </iframe></td>
    </tr>
    </table>
    </code></body>
    
    </html>
    Vic

    God Loves You and will never love you less.

    http://www.vicsjavascripts.org/Home.htm

    If my post has been useful please donate to http://www.operationsmile.org.uk/

  • #3
    New to the CF scene
    Join Date
    Jul 2006
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    It Works

    Fabulous! Thanks so much.


  •  

    Posting Permissions

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