Try adding one or more <a name="fred"> tags in suitable places.
Use dynamic html (say in the body/onload) to jump to an anchor:
document.location.href = sNameOfAnchor
The body/onload function (client side JavaScript) would need to obtain the appropriate anchor name from, say, a hidden field or a static variable (e.g. sNameOfAnchor above) that you write to the page from the Server code. Remember to include a hash (#) mark before the anchor name!
Or you could set the focus to a form element.
Or you could use the scroll(x, y) method - though where you would get the appropriate x, y values from I am not sure (see below).
Or you could use the scrollIntoView() method [IE only].
The following code emulates the scrollIntoView() method for Netscape 6 (not 4) and uses the scroll() method. [also shows how to extend the object model for built in objects via the 'prototype' property]:
** WRITTEN BY MARTIN HONNEN from
**
Apr 16th, 2001 16:00
Here is the code. I only tested for the img element and the layer but I believe it is going to work for other elements as well (as long as NN6 is delivering the correct offsetLeft/offsetTop values).
<html>
<head>
<script language="JavaScript1.5">
function HTMLElement_getPageCoords () {
var coords = {x: 0, y: 0};
var el = this;
do {
coords.x += el.offsetLeft;
coords.y += el.offsetTop;
}
while ((el = el.offsetParent));
return coords;
}
HTMLElement.prototype.getPageCoords = HTMLElement_getPageCoords;
function HTMLElement_scrollIntoView () {
var coords = this.getPageCoords();
window.scrollTo (coords.x, coords.y);
}
HTMLElement.prototype.scrollIntoView = HTMLElement_scrollIntoView;
</script>
</head>
<body>
<input type="button"
value="scroll image into view"
onclick="document.imageName.scrollIntoView();"
/>
<input type="button"
value="scroll layer into view"
onclick="document.getElementById('aLayer').scrollIntoView();"
/>
<div id="aLayer"
style="position: absolute;
left: 1500px;
top: 400px;
background-color: yellow;"
>
Kibology for all
</div>
<script>
for (var i = 0; i < 30; i++)
document.write(i + ' Kibology<br \/>');
</script>
All for Kibology
<img name="imageName" src="kiboInside.gif" />
</body>
</html>
(Content Management)