I have a div with overflow:auto
and a scroll bar, and I'd like to be able to drag the contents to scroll. I don't need to be able to select text. Is there an easy way to do this? A jQuery plugin would be good, otherwise plain old JavaScript would be fine.
It seems I haven't made myself clear enough. There's a div with a fixed height that I want to scroll. Instead of picking up the scroll bar, I want to click and drag inside the text in the opposite direction. Like on an iPhone. Like in Photoshop when you hold down space and drag.
-------------------
| | |
| | |
| |||
| | |
| <----------- click here and drag to scroll.
| | |
| | |
-------------------
To be clear, you single-finger click to start dragging something over to wherever you want it to go; then while holding that finger, an additional two finger gesture can be used to scroll content in any application.
Scrolling text is text that moves onto a website page, by following the direction you define for it. It is dynamically displayed and has the properties you have set for this. Types of such text: Classic (the text is scrolling onto the page in an infinite number of iterations)
Suppose we want to add a scroll bar option in HTML, use an “overflow” option and set it as auto-enabled for adding both horizontal and vertical scroll bars. If we want to add a vertical bar option in Html, add the line “overflow-y” in the files.
An HTML scroll box is a box that grows scroll bars when it's contents are too large to fit in the box. How do you make the box? You create the box using a normal HTML element (such as the div element). Then, to make the box scroll, you apply the CSS overflow property to the div.
Here is a nice implemenation of drag and scroll divs https://github.com/mvlandys/jquery.dragscrollable
below is my original link that I posted. Looks like someone edited my answer.
http://hitconsultants.com/dragscroll_scrollsync/scrollpane.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With