Forum Moderators: open
For example, if a user navigates to
[example.com...]
it will load example.htm and then scroll/center the 'thisanchor' anchor in the center of the page.
Normally it will adjust the page so #thisanchor will appear at the very top of the screen but I want this to be in the center of the screen. Is this possible?
[edited by: tedster at 1:47 am (utc) on Mar. 8, 2005]
[edit reason] use example.com [/edit]
However, placing a named anchor in the exact vertical middle of the window would be more of a challenge. I have thought about it, but decided it wasn't worth the trouble - since browser windows come in so many possible sizes. One approach ould be using javascript to find the vertical middle of the window.
The script would capture availHeight, and then scroll the page an additional amount of half that number.
I'd considered just placing the actual anchor a few lines up so that it will 'appear' vertically centered on the page but my page will start to get very complicated. (it's a dynamically generated page)
Plus it will probably have some issues at the edges of my list.
I was hoping there would be an easy solution to the problem that I have overlooked. Thanks for your input though. I agree that it'll most likely be more trouble for what it's worth.