•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 361,896 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,340 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 17963 | Replies: 11
![]() |
•
•
Join Date: Jan 2008
Posts: 2
Reputation:
Rep Power: 0
Solved Threads: 0
•
•
•
•
You don't need prototype for something this simple. The post just before this actually had the solution.
You can also do something as simple as:
div.scrollTop = 10000;
Giving any element a scrollTop of a number larger than its height will scroll it to the bottom. So any large number you know the div height will not exceed will work.
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*
•
•
•
•
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!
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
- mozilla firefox problem with text in div tag (HTML and CSS)
- How to have the div layer center on any browser? (JavaScript / DHTML / AJAX)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: sample Programs using Ajax controls links or programing code
- Next Thread: Displaying cookie contents in safari?


Linear Mode