I want to draw divs to a specific position using jQuery UI's selectable
,
I've tried it and I thought it's almost figured out: http://jsfiddle.net/62LJG/
The steps I've thought is:
- Fetch
Selectable
's helper'sleft
andtop
. - Fetch
Selectable
's helper'swidth
andheight
. - Append a div to my target and I can use these
left
,top
,width
,height
I've got to CSS this div.
Now my problem is I can't get the width and height from this widget.
I thought all the jQuery UI are similar so I tried this:
$('#tar').selectable({
stop: function(event, ui) {
console.log(ui.size.width + ',' + ui.size.height);
}
});
but this part ui.size
doesn't work.
But I can use ui.size
in jQuery resizable
or draggable
to get width and height.
How can I get width
and height
from jQuery selectable
's helper(dotted line) to achieve my goal?