JQueryUI Resizable has an event called resize that you can use:
var resposition = ''; $('#divresize').resizable({
The same thing happens with JQueryUI Draggable and its drag event:
var dragposition = ''; $('#divdrag').draggable({
resposition and dragposition will be arrays. You can see how it works here: http://jsbin.com/uvuzi5
EDIT: using a form, you can save dragposition and resposition to hidden inputs
var inputres = '<input type="hidden" id="resposition" value="'+resposition.left+','+resposition.top+'"/>' $('#myform').append(inputres); var inputdrag = '<input type="hidden" id="dragposition" value="'+dragposition.left+','+dragposition.top+'"/>' $('#myform').append(inputdrag);
And in your PHP file for processing the form:
$dragposition = $_GET['dragposition']; $resposition = $_GET['resposition']; $dragposition = explode(',',$dragposition); $resposition = explode(',',$resposition);
Finally, both variables must be arrays with top and left attributes:
$dragposition => [top,left] attributes from draggable $resposition => [top,left] attributes from resizable
source share