Y
yootzee
Greetings all,
I'm having a problem with scrolling vertically in a newly created
browser
window. The vertical scrolling is to reach some anchor point within
the new
browser window.
I'm attempting to do this by using an anchor point name of an anchor
located
in the new page as an argument to the JS function opening the new
browser
window. Here's exactly how I'm trying to go about it.
* PageA contains a hyperlink with an onclick event to open a new
page...PageB:
<a href="#" onclick="openPageB( 'someAnchorPoint' ); return false">
where "someAnchorPoint" is the name of an anchor in PageB.
* The JS that I'm using is:
function openPageB( someAnchor )
{
var oNewWin = window.open("/PageB.html", "Help", "width=400,
height=350,
status=no, scrollbars=yes, resizable=yes");
oNewWin.onLoad = window.scrollTo(0, document.anchors[someAnchor]);
oNewWin.focus();
}
My reasoning is based on by belief that document.anchors will return
an integer value based on the geographic location of some given named
anchor within the document object.
What's happening now is that a new browser window is created fine, but
just
can't get the scroll to work; always starts at position 0,0.
Any suggestions are greatly appreciated, and thanks in advance,
yootzee
I'm having a problem with scrolling vertically in a newly created
browser
window. The vertical scrolling is to reach some anchor point within
the new
browser window.
I'm attempting to do this by using an anchor point name of an anchor
located
in the new page as an argument to the JS function opening the new
browser
window. Here's exactly how I'm trying to go about it.
* PageA contains a hyperlink with an onclick event to open a new
page...PageB:
<a href="#" onclick="openPageB( 'someAnchorPoint' ); return false">
where "someAnchorPoint" is the name of an anchor in PageB.
* The JS that I'm using is:
function openPageB( someAnchor )
{
var oNewWin = window.open("/PageB.html", "Help", "width=400,
height=350,
status=no, scrollbars=yes, resizable=yes");
oNewWin.onLoad = window.scrollTo(0, document.anchors[someAnchor]);
oNewWin.focus();
}
My reasoning is based on by belief that document.anchors will return
an integer value based on the geographic location of some given named
anchor within the document object.
What's happening now is that a new browser window is created fine, but
just
can't get the scroll to work; always starts at position 0,0.
Any suggestions are greatly appreciated, and thanks in advance,
yootzee