0

When i drag the element to a droppable area (in clone mode), Every event i use returns source element, But i want to access new created element (in fact clone of draggable).

For example this one:

$( "body" ).on( "drop dragstop deactivate blahblah", function( event, ui ) {
    console.log('ui element', ui);
} );
Morteza
  • 2,097
  • 5
  • 28
  • 47
  • It's unclear what you're asking. What created element? The helper will be referenced in `ui.helper`, but if you want a custom action you have to do it yourself. Also, relying on bubbling is very inefficient. – blgt Apr 23 '15 at 11:27
  • @blgt Ok, sorry for my bad english. When i drag draggable from left side of screen to right side of screen (droppable area), In clone mode, draggable returns to left side and there will be a new cloned element in right side. I want to access it via jquery to style it and some other purposes. But ui.helper returns a reference to draggable element (that returned to left side). – Morteza Apr 23 '15 at 11:38
  • This is clone mode: `$( ".selector" ).draggable({ helper: "clone"});` – Morteza Apr 23 '15 at 11:41
  • 1
    No, `ui.helper` doesn't refer to the reverted original element (could you create a MCVE if you've discovered a bug?). The default behaviour is that the clone is deleted. If you're trying to retain it maybe [this question can help](http://stackoverflow.com/questions/2458817/jquery-ui-drag-and-clone-from-original-div-but-keep-clones) – blgt Apr 23 '15 at 12:54

0 Answers0