...

View Full Version : Changing two iframes at once - problems



canandaigua
08-10-2006, 01:42 PM
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>

vwphillips
08-10-2006, 03:18 PM
<!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>

canandaigua
08-10-2006, 03:44 PM
Fabulous! Thanks so much.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum