2

hey guys, I've already used the jqueryUI draggable function to implement drag&drop behaviour.

This time I wonder if it is easily possible to implement a drag-behaviour to a horizontal scrollbar?

E.g. I have a div-container with images and paragraphs in it. The container has overflow-x scroll and so a scrollbar appears and lets me scroll horizontally through all contents of the container.

Is it possible to implement a drag behaviour so when I click on an image i can drag the entire inner-contents of the container horizontally within the bounds of the container.

sounds complicated I know :) but my plan is actually really simpel. check out this example: http://jsfiddle.net/TT9hq/2/

I just want to be able to drag the contents inside of each horizontal-scrollbar-container like I would use the scrollbar itself.

1 Answer 1

2

You wouldn't really drag the content because the content remains on its place in the parent container (div). You only have to set the scroll position of the container div.

may be you have a look at http://plugins.jquery.com/project/ScrollTo and use scrollTo on mowsedown and mousemove.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.