質問

I have a problem with jQueryUI and the draggable/droppable options.

What I want to accomplished is this:

1) Drag an element into another one 2) Once the element its there, revert the draggable element to its initial state (and do some other stuff)

I can revert the object to its initial state by doing this:

revert : function(event, ui) {
      B(this).data("draggable").originalPosition = {
          top: 0,
          left: 0
      };
      return !event;
}

But I want to revert the element even and when it is dragged into the correct place...

EDIT

I have tried this:

B('#template').find('section').droppable({
  drop : function(e, ui) {
    ui.draggable.triggerHandler('revert');
  }
}

But it is not working... I have also tried to get the option and execute it, but it is also not working.

役に立ちましたか?

解決

If you always want to revert, just return true in your revert function

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top