Question/bug with draggables and CursorAt
Hi all,
I might have found a bug but I'm not sure. Maybe someone else has had
this experience and can help me find a solution, or confirm that this
is indeed a bug.
I'm implementing a draggable, and the draggable element can be fairly
large. I want to constrain the cursor to the center of the object to
make finding the small droppable targets we're using easier. Here's
my code:
$('.draggable').each(function() {
$(this).draggable({ revert: true,
cursorAt: { top: Math.round($(this).height() /
2),
left: Math.round($(this).width() /
2)},
handle: '.handle' });
});
The interesting part is that the left works, but the top doesn't!
When the drag begins the element's l-r midpoint snaps under the
cursor, but its height doesn't adjust.
In firebug, if I pull up a particular .draggable element, and ask for
Math.round($('#draggable_3').height() / 2) as a watch then I get a
good answer. So I'm thinking this is an issue with the library.
Any advice would be greatly appreciated. Thanks!