Ah-ha, someone else with the same problem. I am currently working on an
example that copes with this. Unfortunately the code for Netscape and IE is
quite different as they hold different things in the anchor object. However,
I shall try and finish the example today or tomorrow and post it asap.
Basically you need to use something like the following:
<SCRIPT LANGUAGE="Javascript">
function jumpTo(name) {
if(is.ns) { // netscape section
for(x=0;x<LayerPanel.doc.links.length;x++) { // search the list of links
for a match
if(LayerPanel.doc.links[x].hash == name) { // found it
y = (LayerPanel.doc.links[x+1].y); // get the y position
r = (y)/LayerPanel.getContentHeight(); // calculate the ratio
o = ((r-0.15) * scrollH); // adjust to ensure the anchor is near the
top
y += o;
if(y<scrollH/4) y=0; // if it low enough, make it 0
r = (y)/LayerPanel.getContentHeight(); // calculate adjusted ratio
LayerScroll.setRatioY(r); // position the pane
LayerScroll.vbar.setRatioY(r); // position the scroll bar
return;
}
}
} else { // others section
for(x=0;x<LayerPanel.doc.links.length;x++) { // search the list of links
for a match
if(LayerPanel.doc.links[x].hash == name) { // found it
y = ((x==0)?0:LayerPanel.doc.links[x].pixelTop); // get the y position
r = (y)/LayerPanel.getContentHeight(); // calculate the ratio
o = ((r) * scrollH); // adjust to ensure the anchor is near the top
y += o;
if(y<scrollH/4) y=0; // if it low enough, make it 0
r = (y)/LayerPanel.getContentHeight(); // calculate adjusted ratio
LayerScroll.setRatioY(r); // position the pane
LayerScroll.vbar.setRatioY(r); // position the scroll bar
location.href=name;
return;
}
}
}
</SCRIPT>
LayerPanel is the inner layer with the HTML on it and the LayerScroll is the
scrolling layer with the LayerPanel within it.
Then in the page you have the link as:
<A HREF='javascript:jumpTo("#misc")'>Miscellaneous</A><BR>
and then the reference is
<A NAME="misc"></A><A HREF="#misc"></A>Miscellaneous Workspaces<BR>
It needs the two anchors due to the way the anchor object stores it's
values, they're different for named anchors and hyperlink anchors.
Hopefully that'll get you started.
Barbie.
_______________________________________________
Dynapi-Help mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dynapi-help