RE: one frame tells another to jump to anchor
by Chuck Evans <Chucke(at)captura.com>
|
| Date: |
Tue, 9 Jan 2001 11:54:01 -0800 |
| To: |
"'Complex'" <complex_hwg(at)yahoo.com>, Languages HWG <hwg-languages(at)hwg.org> |
| |
todo: View
Thread,
Original
|
|
A basic Back To Top link in nav frame (without javascript) would look like
this:
<a href="main_frame_page.html#Super-page_top" target="main">Back To Top</a>
So if you want it to change on its own, why not just document.write the link
with the parent.main.location.pathname value?
(Not tested by me)
document.write("<a href='" + parent.main.location.pathname +
"#Super-page_top' target='main'>Back to Top</a>");
Chuck Evans
Captura, Inc.
(425) 803-6455
http://www.captura.com
-----Original Message-----
From: Complex [mailto:complex_hwg(at)yahoo.com]
I can't wait for this Intro JavaScript class to finish. :-) I'm trying
to cobble together enough simple code to do this:
I have a two-frame frameset. I want the "Back to Top" link in the left
frame (name="nav") to tell the right-hand frame (name="main") to go to
an anchor (anchor's name: "Super-page_top"). Sounds simple...
I took one look at Adobe GoLive 4's ready-to-go scripts and decided I'd
rather code my own. That's nothing new.
I tried this: The link in the left frame is:
<a
href='javascript:parent.main.location.replace(parent.main.location.pathname
+ "#Super-page_top");' title="blah" onmouseover='window.status="blah";
return true;'>
Go to top
</a>
Problems:
1) When I open the local (hard drive) copy of my site,
scroll down or follow a link to an anchor lower on the page,
and click this link,
1a) the main frame jumps to the top as it should, but
1b) the nav frame displays the text of the _old_ location of the main
frame. If I had followed a link to an anchor, like indexbody.html#gel,
then "file:///blah/blah/indexbody.html#gel" gets displayed in the nav
frame.
2) When I do the same thing with the uploaded test copy,
the nav frame reloads and that's all.
The test copy is (at a corporate site)
http://www.scanalytics.com/webtest/index2.html, but I will probably
change these pages frequently. (You can follow the info link to a long
page with anchors.)
Please tell me
I> What am I doing wrong that displays the old main location in the nav
frame,
II> What am I doing wrong that the main frame doesn't go to the top in
the uploaded version (or all else is moot!),
III> If there's simply a better way!
HWG: hwg-languages mailing list archives,
maintained by Webmasters @ IWA
This page is part of a preserved archive of archives.hwg.org. The site is no longer active and its content is not maintained. For enquiries about this archive, write to archive(at)iwanet.org.