using jquery draggable can you create a helper based on the dragged item?

Posted by user169867 on Stack Overflow See other posts from Stack Overflow or by user169867
Published on 2010-03-23T02:50:00Z Indexed on 2010/03/23 23:23 UTC
Read the original article Hit count: 556

Filed under:
|

I wish to create a custom helper based on the element being dragged. I'm dragging documents and I'd like the document's number to be part of the custom helper.

I know how to create a helper during init like this:

helper: function()
        {
            return $("<div class='fax16'></div>");
        }

But what I really want to do is maybe in response to the start event get access to the element being dragged and use some of its properties to set the helper.

Something like:

start: function(event, ui)
{
   var docID = //somehow access the dragged element
   ui.helper = $("<div class='save16'>" + docID + "</div>");  //Set drag Helper    
}

Can this be done?

© Stack Overflow or respective owner

Related posts about jquery-ui

Related posts about jQuery