Re: Calling two frame pages with one click?
by Jeremy Duncanson <jeremy(at)luminet.net>
|
Date: |
Thu, 13 Jan 2000 21:13:12 -0500 |
To: |
hwg-techniques(at)hwg.org |
References: |
net |
|
todo: View
Thread,
Original
|
|
At 5:37 PM -0800 on 1/13/00, 2Nerotik wrote:
> <Script language="JavaScript">
> <!--
> function LoadPages() {
> parent.Content.document.location="Test2.html"
> parent.Menu.document.location="Test1.html"
> }
> //-->
> </SCRIPT>
>
> <BODY>
> <A HREF="javascript:LoadPages();">load Pages</A>
> </BODY>
>
> Where Content and Menu are the frames you are targeting. You will of course
> need a separate function for each link where you want to load more than one
> page.
You could do it with a single function in javascript if you use
the name of the page you wish to load as a variable passed to
the function. Ie:
<Script language="JavaScript">
<!--
function LoadPages(menu, page) {
parent.Content.document.location = menu;
parent.Menu.document.location = page;
}
//-->
</SCRIPT>
<BODY>
<A HREF="javascript:LoadPages('menu2.html', 'intro2.html');">load Pages</A>
</BODY>
> At 05:59 PM 13/01/2000 +0000, Roger Stenning wrote:
> >Hi.
> >
> >I'm sure that this has been asked before, but can't recall the answer.
> >
> >I'm re-launching my hobby site in a month or so, and, central to this, I'd
> >like to be able to change both the main and menu parts of a frameset with a
> >single click (menu calls a sub-site within the same frameset), *without* the
> >use of any form of scripting bar HTML4.
> >
> >While I'm not at all sure it's possible, has anyone managed to solve this?
> >
> >Thanks in advance.
Yes and no. I don't think you can do precisely what you are trying to
accomplish using just HTML. However, you could have your homepage,
index.html, be a single frameset which loads another page containing
two framesets with one as your menu and the other your content page.
Something like this:
index.html
html
frameset
frame src="main.html" name="mainFrame"
/frameset
/html
main.html
html
frameset cols="60, *"
frame src="menu.html" name="menuFrame"
frame src="welcome.html" name="contentFrame"
/frameset
/html
When you switch to the submenu, you would need to target the top
frame and load it with a page like main.html which would have the
submenu and whatever content you wish to have default with it.
a href=sub1.html target=mainFrame /a
sub1.html
html
frameset cols="60, *"
frame src="sub1_menu.html" name="sub1Frame"
frame src="welcome.html" name="contentFrame"
/frameset
/html
You might have to play with the syntax a bit, but the general
idea should work. It leaves the webpage in frames and gives
the appearance of what you are trying to do, but it doesn't
do exactly what you had asked.
HTH,
Jeremy
HWG hwg-techniques mailing list archives,
maintained by Webmasters @ IWA