Bob
Bob

Reputation: 21

JQuery Resizable Draggable Position Absolute

Take a look at this -> http://jsfiddle.net/Zj23S/1/

I am using resizable and draggable. The problem I am facing is with draggable. I cannot seem to drag outside of the div, probably because I set div.position = absolute. If I take this away my resizing moves the other elements, which I do not want. How can I drag the element anywhere on the screen while maintaining position absolute?

Thanks!

Upvotes: 2

Views: 9236

Answers (3)

Alexey
Alexey

Reputation: 231

it's a problem in resizable:

(f.is(".ui-draggable")||/absolute/.test(f.css("position")))&&f.css({position:"absolute",top:e.top,left:e.left})

So, the only thing you should do is removing class .ui-draggable and all will be OK, because the check will fail if start position of the elements was relative.

You can do it by adding

{... addClasses: false ...}

setting in your draggable options

Upvotes: 3

Filip Cornelissen
Filip Cornelissen

Reputation: 3742

Is this what you wanted? http://jsfiddle.net/Zj23S/15/

Upvotes: 3

Related Questions