covertuta.blogg.se

What is auto scrolling
What is auto scrolling





what is auto scrolling

It also allows you to animate the scrolling which can be quite pleasing to look at: new Fx. 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. *By accident I found this thread and thought this could be interesting for someone else finding also the thread* 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. So any large number you know the div height will not exceed will work.Ĭrystal clear, but this was not what I wanted. Giving any element a scrollTop of a number larger than its height will scroll it to the bottom. You can also do something as simple as: div.scrollTop = 10000 The post just before this actually had the solution. You don't need prototype for something this simple. Whith that you can easily scroll to a specific element in your scroll container: $('scrollContainer').scrollTop = $('scrollTo3').cumulativeScrollOffset() :icon_eek: Whoops. Scrolling a scrollable DIV tag is pretty easy by using the fabulous prototypejs framework by Lets see what we've got here. Hi guys, I know this thread was years ago, but I think many many people are looking for a solution for this problem but not finding anything.

what is auto scrolling

Search for those terms, you should easily find everything you need, which is why I didn't spell it all out for the previous poster. You'll need to use the offsetTop and offsetParent properties to make the code robust. This doesn't take into account that the DIV might be nested, etc. I simply measure the clientHeight of the DIV element, and tell the browser to scroll to that position. Curabitur tincidunt.įusce est velit, condimentum sed, convallis in, blandit hendrerit, eros. Suspendisse a mi vitae nulla vehicula lacinia. Etiam egestas.ĭonec vitae mauris vitae nisi gravida pharetra. Nullam in odio ac augue porttitor semper. Lorem ipsum dolor sit amet, consectetuer adipiscing elit.ĭonec tristique lectus sit amet est. Here's a simplistic example of scrolling: You can know the size of an element, using it's "clientHeight" property, for example, and its position on the page, using offsetTop & offsetParent. However, you can scroll the browser window, using the "scrollTo()" method. You cannot scroll, as far as I know, the inner contents of a DIV element. You have to explain exactly what it is you want. It will scroll to the bottom so you can see what you just added. So, you type something in and click Add Stuff. Stuff Stuff Stuff Stuff Stuff Stuff Stuff Stuff Stuff I'd like to be able to automatically scroll the DIV to the bottom when you add stuff to it. I wrote this little code segment to illustrate the idea of what I want.

what is auto scrolling

but it wasn't even remotely in the right spot before.







What is auto scrolling