Behrang Saeedzadeh
Behrang Saeedzadeh

Reputation: 47971

How to access jQuery draggable's helper element inside the drag callback?

I have a draggable with a custom helper function defined like this:

$("article.post").draggable({     
  helper: function(e) {
    // return a dom element
  },
  drag: function(event, ui) {
    var helper = $this.draggable( "option", "helper" );
    // helper is not the returned dom element, but the function definition
  }
});

In the drag callback, I want to access the helper element returned by the function, but $this.draggable( "option", "helper" ) returns the function definition instead.

Is there a way to access the helper element?

Upvotes: 0

Views: 231

Answers (1)

Behrang Saeedzadeh
Behrang Saeedzadeh

Reputation: 47971

Okay, it turns out it is accessible via ui.helper.

Upvotes: 1

Related Questions