Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Question about frames

Status
Not open for further replies.

spacebass5000

Programmer
Nov 26, 2000
144
US
I want to make a link that opens up a frame index. I want this link to specify a page to display in the frame index's "main" frame that is different from the default page specified in this frame index. How do i do this?

Thanks in advance!
 
huh??? what????
if you are just tryin to link to a framed page then that is easy just make a site using however many frames you want...i never go over2 (EVER)....then say you lhave left frame and right frame and right frame is your main window and the left is you say navbar they are both combined by your framset file which say would be index.htm and this index htm would contain left.htm and right.htm :understand so far:

so you just link to index.htm and have rigt htm be whatever page you want and left.htm be another page

[afro] excuse me can i have some more
 
SpaceBass5000, are you referring to iFrame and iLayers??
If so, this might help you:

for iFrame (only for IE and NS6+):
<iframe src=&quot;pagetobelinked.html&quot; name=&quot;nameofiframe&quot; height=&quot;100%&quot; width=&quot;540&quot; bottomscroll=&quot;no&quot; frameborder=&quot;0&quot; bgcolor=&quot;&quot;></iframe>


iLayer (for NS4 and NS4.72):
<layer src=&quot;pagetobelinked.html&quot; name=&quot;nameofiframe&quot; height=&quot;275&quot; width=&quot;540&quot; NoResize Scrolling=&quot;no&quot; FrameBorder=&quot;1&quot;></layer>

I have not failed; I merely found 100,000 different ways of not succeding...
 
not exactly ya'll.. thanks though!

Say I have a frameset page and say that it contains top.html(&quot;top&quot; frame) and main.html(&quot;main&quot; frame). BUT! I want to call this page via a hyperlink that specifies the frameset page to replace the &quot;main&quot; frame with a page OTHER than the one it is set to display(ie something other than main.html).

Is this possible?
 
i'm actually struggling with the exact same problem and have yet to solve it to my satisfaction. if you don't mind opening a new window, you can use javascript to create the frameset on the fly.

for example, you could create a function like the following to call when a link is clicked...

Code:
function openFrames(contentPage)
{
var fw;
fw = window.open(&quot;&quot;,&quot;frameWin&quot;);
fw.document.open();
fw.document.write(&quot;<html><head><title></title></head>&quot;);
fw.document.write(&quot;<frameset rows='55,*,30' border='0' frameborder='0'>&quot;);
fw.document.write(&quot;<frame name='heading' src='heading.htm' marginwidth='20' marginheight='2' scrolling='no' noresize target='_self'>&quot;);
fw.document.write(&quot;<frame name='content' src='&quot; + contentPage + &quot;' scrolling='auto' noresize marginwidth='24' marginheight='24' target='newWindow'>&quot;);
fw.document.write(&quot;<frame name='menuBar' src='menuBar.htm' marginwidth='0' marginheight='6' scrolling='no' noresize target='content'>&quot;);
fw.document.write(&quot;</frameset></html>&quot;);
fw.document.close();
}

then, in your document with the links, you could something like have....

Code:
<a href=&quot;javascript: openFrames('news.htm')&quot;>News</a>
<a href=&quot;javascript: openFrames('music.htm')&quot;>Music</a>

again, however, this results in a new window being opened, which is most likely not acceptable. i had messed around with getting the frameset to rewrite itself, but haven't got it working yet.

glenn
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top