I have a large document with numbered anchor tags as shown below. And a textbox to punch the numbers in to go to anchor which uses window.location.hash
I am also using arrow keys to go next or previous anchors. I want to scroll to the anchor so to give some sense of direction.
<a name="1">
some text
<a name="2">
some text
<a name="3">
here is my function
function updatePageNumber()
{
var pagenumber;
pagenumber = document.getElementById('pageNumber').value;
window.location.hash = pagenumber;
}
Jumping to anchor is very ugly and people loose sense of direction in the text. So is there a way to scroll to anchor with JavaScript. I know there are lots of jQuery examples, but I don't know jQuery and couldn't find JavaScript.
Most important reason is I want to see my page number on the address bar!