Originally Posted by
dRoot84
Crystal clear, but this was not what I wanted. Sure you can scroll to the bottom of an Element by just giving it a very large number that sure will be larger than its content height, but what I ment was to scroll to a specific position in the scrollable div, and thats what I showed.
*By accident I found this thread and thought this could be interesting for someone else finding also the thread*
Oh I missed your point. Yes, the original post was just on how to scroll to the bottom but yours shows how to scroll to any element in a DIV. Good one.
Offtopic:
Here is how you do it with mooTools. It also allows you to animate the scrolling which can be quite pleasing to look at:
new Fx.Scroll(Parent, {
wait: false,
duration: 500,
transition: Fx.Transitions.Quad.easeInOut
}).toElement(Child);
Where
Parent is the Element the element with the overflow/scrollbars and child is a
Child element within the scrolling element.
You could substitute child for: Parent.childNodes[
n] where n is the index of the childNode. (IE6 may cough on empty Text Nodes)
www.fijiwebdesign.com - web design and development and fun
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!