Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an easy way to do click-and-drag scrolling in text frames?

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.
|               | |
|               | |
-------------------
like image 782
Skilldrick Avatar asked May 18 '10 14:05

Skilldrick


People also ask

How do you scroll while dragging?

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.

What is text scrolling?

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)

How do I enable scrolling in HTML?

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.

What is scrolling textbox?

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.


1 Answers

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

like image 66
John Hartsock Avatar answered Nov 03 '22 00:11

John Hartsock