Yep so here is a question - how to set custom handles for a resizable img
element?
I have image element, which is set to be resizable() with jQuery UI. In order to set custom handles, they need to be child elements of the resizable element. However this is not possible with image element.
jQuery UI docs specify that you can also set handles from outside of the resizable element: http://api.jqueryui.com/resizable/#option-handles
The value of any specified should be a jQuery selector matching the child element of the resizable to use as that handle. If the handle is not a child of the resizable, you can pass in the DOMElement or a valid jQuery object directly.
My JSFiddle: http://jsfiddle.net/asavin/2LXG8/3/
JS:
$('#elementResizable').resizable({
handles: {
'nw': '#nwgrip',
'ne': '#negrip',
'sw': '#swgrip',
'se': '#segrip',
'n': '#ngrip',
'e': '#egrip',
's': '#sgrip',
'w': '#wgrip'
}
});
You can see the handles, but they doesn't do anything.
Here is another related question on SO, also without answer: jQuery UI resize custom handles, not children of the resized element
I'm also open for alternative solutions. The point is to get image resizable, and to have custom handles.