i am using jquery resizable to resize a div
$("#mainDiv").resizable({
handles: 's, e',
start: function(event, ui) {
// want to perform some action here
},
resize: function(event, ui) {
// want to perform some action here }
});
now i want to do some stuff based on fact that whether s
or e
is selected to resize basically resizing is vertical or horizontal how to do that
Thanks
The axis is placed as data on your element under ui-resizable
like this:
$(element).data('ui-resizable').axis
// the following will return direction as "n", "e", "s", "se" etc.
$("#selector").resizable({
resize: function(e, ui) {
// for jquery-ui 1.9.2
var direction = $(this).data('resizable').axis;
// for jquery-ui 1.11.4
var direction = $(this).data('ui-resizable').axis;
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With