I'm creating a custom drag helper (in jQuery):
$('.dragme', element).draggable({
appendTo: 'body',
helper : custom_drag_helper,
opacity : 0.5
});
I'm doing this because I want to sometimes clone and sometimes do the default functionality, i.e. drag the original element.
function custom_drag_helper() {
if (/*criteria on when to move instead of clone */) {
return $(this); /* this is what helper: 'original' seems to do */
} else {
clone = $(this).clone(); /* this is what helper: 'clone' does */
return clone;
}
}
But I can't get the original functionality to work at all. return clone() works fine but return $(this) gives no joy.