Set Resizable handles after init
I am new to jQuery. Can someone please help me solve an issue with
using the setter on the handles after the init? I can not get the
handles to change. I can not find what I have done wrong.
The .resizable('option', 'maxHeight', 300) works but the handles
setter doesn't. I tried the setter with a button click as well as the
callback on the stop event.
Here is my script.
$(function() {
jQuery.fn.makeResize = function() {
$(this)
.resizable({
grid: [60, 20],
minHeight: 80,
minWidth: 100,
containment: '#test',
handles: 'e, se',
stop:
function (event, ui) {
$(this).resizable('option',
'maxWidth', 300);
$(this).resizable('option', 'handles',
'w');
}
})
.appendTo('#test');
};
$('#handlesTest').click(
function() {
$('.ui-widget-content').resizable('option',
'maxWidth', 500);
$('.ui-widget-content').resizable('option', 'handles',
'w');
});
$('#addResizable').click(
function(){
$('<div class=\"ui-widget-content\"></
div>').makeResize();
}
);
});
Thanks for any help you may be able to provide.