What you are looking for is possible, but it is not JavaScript.. Rather, it is part of the HTML standard. Just use simple anchor tags (<a>) but instead of using the href attribute, you use the name attribute. That creates an anchor to a page spot (like half way down a long page).. then, when you want to link to that page AT the anchored spot you would use: index.html#named_anchor
The pound sign '#' is a directive that says "look for an anchor in this page with the same name.." or something of the sort..
An example would be:
Filename = mypage.html:
CODE
<html>
<head>
</head>
<body>
<a name="pageTop"></a>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<a href="mypage.html#pageTop">Go To Top of Page</a>
</body>
</html>
I hope you could follow that.. it is pretty simple really.. And you don't have to direct to the top of a page, it could be anywhere, wherever you put the <a name="pageTop"></a> tag(s) you can link to..
I hope that helps!
Reply