Search code examples
jqueryjquery-uijquery-ui-resizable

How to know which handle is getting used in jquery resizable


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


Solution

  • The axis is placed as data on your element under ui-resizable like this:

    $(element).data('ui-resizable').axis