views:

656

answers:

1

I have a scrolling:auto problem with JQuery 1.4.2 and JQuery 1.7.2. I have a container DIV with 2 DIVs inside it. Like this:

<div id="dragContain">

<div id="dragMe">
  <div>Title goes here!</div>
  <div style="scrolling:auto;">Content goes here!</div>
</div>

</div>

And I enable dragging the group by:

$('#dragMe').draggable({
  containment: '#dragContain', cursor: 'move', zIndex: 20000
});

And, when I do so, in FF the scrolling only works with the mouse wheel. Grabbing the scrollbar causes a drag event and moves the group. It works fine in IE.

Is there any way to correct this? Can I make only the titlebar a grab handle which causes a drag on the parent div?

Thanks!

+3  A: 

You could try using a handle instead. So the user would drag and drop the h2 element instead of the whole of #dragMe.

$('#dragMe').draggable({
  containment: '#dragContain', cursor: 'move', zIndex: 20000, handle: 'h2'
});

.

<div id="dragContain">

<div id="dragMe">
  <h2>Title goes here!</h2>
  <div style="scrolling:auto;">Content goes here!</div>
</div>

</div>
Ben Shelock
Awesome! That did it. Thank you very much!
Erick