Michael Michael - 1 month ago 13
Javascript Question

How to get X Y coordinates in resizable function?

I use resize method on jquery-ui, here is my function:

$( function() {
$( "#resizable" ).resizable();
startResizing(event.clientX,event.clientX)//how to get coordinates

And here my resizable div:

<div id="resizable" class="ui-widget-content">
<h3 class="ui-widget-header">Resizable</h3>

In the function above when div resizable is resized I need to call function named
and pass X,Y coordinates.

My question is how can I get X,Y coordinates call
function each time when div have been resized?


You can use the resize event of the resizable method:

$(function() {
        resize: function(e, ui) {
            startResizing(ui.position.left, ui.position.right);

More info available in the jQuery UI documentation: http://api.jqueryui.com/resizable/#event-resize