| | |
AutoScrolling a DIV tag
Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jan 2008
Posts: 2
Reputation:
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:
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
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.
*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*

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:
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
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!
![]() |
Similar Threads
- 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?
Views: 37429 | Replies: 11
| Thread Tools | Search this Thread |
Tag cloud for JavaScript / DHTML / AJAX
acid2 ajax ajaxcode ajaxhelp animate array automatically autoplay beta boarder box bug button calendar captcha card cart codes column cookies createrange() css cursor date debugger decimal design developer dom download dropdown element enter error events firefox firehose flash focus form frameworks getselection google gwt html htmlform iframe image() index java javascript javascripts jawascriptruntimeerror jquery jsp listbox maps marquee masterpage menu microsoft mimic mp3 mp4 offline onmouseover parameters php player post problem programming progressbar prototype rating redirect regex safari scale scriptlets search select size sources sql starrating text textarea toggle twitter validation variables w3c web website window windowofwords windowsxp xml xspf






