views:

130

answers:

1

Hi

I'm just wondering if anybody else can manage to get the tolerance:'fit' option to work when using the 'droppable' feature in jQuery's UI?

I want to call a function only when the draggable div is dropped perfectly onto a droppable div. Both divs are the same size and I'm using snapMode:outer to help the end user.

I simply cannot get it to work with 'fit'. Works perfectly with 'intersect'.

Would really appreciate some help.

Thanks Chris

A: 

I stumbled over the same problem and it seems that for the time being you need to patch jquery-ui to make it work.

The patch is extremely simple and obvious and is described in the following jquery-ui bug report: http://dev.jqueryui.com/ticket/5689

I have no idea if this is really a bug or a "feature", though.

davidroetzel
Hey David – thanks for this.It drove me mad. As a workaround, I ended up nesting the 'snapping' div inside the droppable div, making the droppable div 1px bigger to the top, right, bottom and left.
Chris