Snippet #1
A p r
2 3
2 0 1 0
Here's a quick snippet for making something draggable and resizeable in jQuery (like my beard!).
$('#beard').draggable().resizeable(); |
WRONG
This "works" but gives unexpected behavior. Flipping the order you chain the calls results in weird behavior as well.
Because resizeable adds a wrapper div to any object you make resizeable, the dragging gets spotty and/or the area of movement gets constrained.
So you have to play nice with the inserted wrapper:
1 2 |
$('#beard').resizable(); $('#beard').parent('.ui-wrapper').draggable(); |
I'll leave error cases for you.