ali asad
ali asad

Reputation: 1349

How to set Position of jQuery UI draggable relative to parent and position propert to absolute

I want to set position of my jQuery UI Dragable element to absolute so it takes no space in the document flow. But after doing this when I try to drag it. It moves out of the document. Is there a way so I can set its position relative to position of its container div. Thanks

Upvotes: 0

Views: 2687

Answers (1)

Robert
Robert

Reputation: 694

Perhaps the way it's documented on http://jqueryui.com/draggable/#constrain-movement

For example:

$('.divelement').draggable({
  containment: $('body')
});

Or explain it a with jsFiddle, please.

Upvotes: 1

Related Questions