Click to See Complete Forum and Search --> : Scrollingn to an object


Webskater
01-10-2004, 01:05 PM
Can anyone tell me the best way to make sure an object is in the browser window when it is made visible - or moves into view when it is made visible.
Thanks for any help.

Khalid Ali
01-10-2004, 01:46 PM
you can find objects position and then use window.scrollTo(x,y) to match its position, I am hoping this will do it.

fredmv
01-10-2004, 01:56 PM
You could always use position: fixed but that is only supported by Gecko, however, there are workarounds for IE. If you're looking for a JavaScript solution, the HTMLElement.scrollIntoView method should do what you want.