Click to See Complete Forum and Search --> : Open the content of one Frame in another Frame..?


cakeday
08-25-2003, 11:50 AM
What i want to do is,
divide the webpage in 2 frames. The one of the left hand side should have a collapsible folder tree menu with its own scrollbar for when the folder menu collapses and expands. And when some clicks on one of the link on the Left hand side, i want the link to open on the right hand side frame.

And, i want the data in both the frames to be seen at all point in time.

what i have right now, is a folder tree, on the left hand side frame, but when i click on one of the links it opens the link in a different window.. what do i have to do, so that it opens in the frame on the Right hand side. Also, i want a individual scroll bars for both the frames.

You can find the code that i have below.

FYI, i am a very beginner level javascript programmer!

Thank you!


<HTML>
<HEAD>
<TITLE></TITLE>
<style>
<!--
#foldheader{cursor:hand ; font-weight:bold ;
list-style-image:url(fold.gif)}
#foldinglist{list-style-image:url(list.gif)}
//-->
</style>
<script language="JavaScript1.2">

var head="display:''"
img1=new Image()
img1.src="fold.gif"
img2=new Image()
img2.src="open.gif"

function change(){
if(!document.all)
return
if (event.srcElement.id=="foldheader") {
var srcIndex = event.srcElement.sourceIndex
var nested = document.all[srcIndex+1]
if (nested.style.display=="none") {
nested.style.display=''
event.srcElement.style.listStyleImage="url(open.gif)"
}
else {
nested.style.display="none"
event.srcElement.style.listStyleImage="url(fold.gif)"
}
}
}

document.onclick=change

//-->
</script>

</HEAD>
<BODY>





<TABLE WIDTH="95%" BORDER="0" CELLSPACING="0" CELLPADDING="0" HEIGHT="100%">
<TR>

<TD WIDTH="160" STYLE="BORDER-RIGHT: solid 3px" BORDERCOLOR="#8f8fc9" VALIGN="TOP">
<table width="250" border="0" cellspacing="0" cellpadding="0" class="bodytext">
<tr>
<td><img src="/images/spacer.gif" width="250" height="8" align="bottom"></td>
</tr>
<tr>
<td>
<font color="#013894" size="2" face="Verdana, Arial, Helvetica, sans-serif"><b>Archives</b></font></div>
</td>
</tr>
<tr>
<td><img src="/images/line_horz2.gif" width="250" height="4"></td>
</tr>
<tr>
<td> </td>
</tr>
<tr valign="top">
<td style="padding-left:5; padding-top:5;">

<ul>
<li id="foldheader">2001</li>
<ul id="foldinglist" style="display:none" style=&{head};>
<li><a href="http://www.cnn.com", target="_blank">January '01</a></li>
<li><a href="http://www.abcnews.com", target="_blank">February '01</a></li>
<li><a href="http://www.abcnews.com", target="_blank">March '01</a></li>
<li><a href="http://www.abcnews.com", target="_blank">April '01</a></li>
<li><a href="http://www.abcnews.com", target="_blank">May '01</a></li>
<li><a href="http://www.abcnews.com", target="_blank">June '01</a></li>
<li><a href="http://www.abcnews.com", target="_blank">July '01</a></li>
<li><a href="http://www.abcnews.com", target="_blank">August '01</a></li>
<li><a href="http://www.abcnews.com", target="_blank">September '01</a></li>
<li><a href="http://www.abcnews.com", target="_blank">October '01</a></li>
<li><a href="http://www.abcnews.com", target="_blank">November '01</a></li>
<li><a href="http://www.abcnews.com", target="_blank">December '01</a></li>
</ul>

<li id="foldheader">2002</li>
<ul id="foldinglist" style="display:none" style=&{head};>
<li><a href="http://www.cnn.com", target="_blank">January '01</a></li>
<li><a href="http://www.abcnews.com", target="_blank">February '01</a></li>
<li><a href="http://www.abcnews.com", target="_blank">March '01</a></li>
<li><a href="http://www.abcnews.com", target="_blank">April '01</a></li>
<li><a href="http://www.abcnews.com", target="_blank">May '01</a></li>
<li><a href="http://www.abcnews.com", target="_blank">June '01</a></li>
<li><a href="http://www.abcnews.com", target="_blank">July '01</a></li>
<li><a href="http://www.abcnews.com", target="_blank">August '01</a></li>
<li><a href="http://www.abcnews.com", target="_blank">September '01</a></li>
<li><a href="http://www.abcnews.com", target="_blank">October '01</a></li>
<li><a href="http://www.abcnews.com", target="_blank">November '01</a></li>
<li><a href="http://www.abcnews.com", target="_blank">December '01</a></li>
</ul>

</td>
</tr>

</table>
</TD>

<TD WIDTH="30"><IMG SRC="/products/images/spacer.gif" WIDTH="30" HEIGHT="5"></TD>

<TD VALIGN="TOP">
<TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0">


<TR>
<TD COLSPAN="3">&nbsp; </TD>
</TR>
<TR>
<TD COLSPAN="3">
<div align="left">

</div>
</TD>
</TR>
<TR>
<TD COLSPAN="3" valign="top"><span class="requiremetssm">Hello!?
</span><br>
<span class="bodytext">Good Morning!</span></TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>

</BODY>
</HTML>

Khalid Ali
08-25-2003, 12:34 PM
add this in the frame ones head section

<base target="secondframesName"/>

cakeday
08-25-2003, 12:47 PM
Okay, now i guess, i am totally confused!!

What i have doesn't look like it is in frames..=(

How do i define FRAMES? In my code, i don't see, FRAME1 and FRAME2..

I guess, what i need to begin with is the code for FRAMES..

Help!!

cakeday
08-25-2003, 01:32 PM
My code looks like the following.

What is happening though is, my link opens correctly in the FRAME ON my RIGHT, but when i click on the second link in the NAVIGATIONAL-TOOLS, it opens in a new window..?? why does it do this?

My MASTER DOCUMENT FOR frame looks like,
<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>

<FRAMESET rows="200, *">
<!-- creates first row as header -->
<FRAME name="header" SRC="header1.html">
<H2>HELLO!!</H2>

<FRAMESET cols="25%, 75%">
<!-- creates columns on left for navigational tools -->
<FRAME name="navigate" src="C:\Working\navigational-tools.htm">

<!-- creates first row as header -->
<FRAME name="main" src="home.html">

</FRAMESET>
</FRAMESET>

</HTML>




My NAVIGATIONAL-TOOLS.htm looks like as follows,
I added the <base target="main"/> part in my HEAD section of my html page..

<html>
<head>
<base target="main"/>
</head>
<body>
<a href="http://www.cnn.com">News1</a>
<a href="http://www.cnn.com">News2</a>
<a href="http://www.cnn.com">News3</a>


</BODY>
</HTML>

Khalid Ali
08-25-2003, 01:35 PM
do u have a link to these pages ????

cakeday
08-25-2003, 02:15 PM
I am not sure what you mean when you ask me, if i have a link to these page?

I sure do. All the links are going to be pointed to a .PDF documents..