views:

323

answers:

3

i have a draggable div that has the overflow position to auto, so when the content is too big and i get a scroll bar,

since i haven't added a handle (i want the hole content of the div to drag it) when you use de scroll bar the div moves/draggs....

is there a way of excluding an element from the handle of a draggable div in jquery?

i need something like handle: not(#thisTable)

is there a way of doing this with selectors or something like that?

tnx in advanced

Fortes

A: 

Add a div inside your div, width & height 100%, no margin, no padding, and put your content there. Set its overflow to default and set it as the handle. That way, the scrollbar of the parent div will no longer be in the handle, thus not initiating the drag.

Julian Aubourg
A: 

tnx for your answer, but i found what i think is a better solution....

there is another option for draggable called 'cancel' and it excludes the selected element from the handle of the draggable element...

$('#container').draggable('option', 'cancel', '#excludedElement');

hope this helps someone else...

Fortes
A: 

How did you specify the scrollbar as excludedElement?

Uszy Wieloryba
You have to cancel the element that holds the scrollbar.. (is container div)
Fortes