I don’t know how much simpler it will be, but I came up with this option: during the beginning of the resize, a class is added to the element, depending on what border we’ve grabbed: ui-resizable- {direction} (where direction is it is a symbol of handles). Therefore, we can use this feature . Let me draw your attention to the fact that the example is based on the fact that standard handles are used and in this case only those that you have listed! Otherwise, one should take into account that handles may consist of several characters ( ne, se, sw, nw, all ) or some additional classes are used. Then you will need to think about how to get the desired class and, accordingly, from it the value of the direction.