JQuery UI resizable example (with buggy jquery-ui)

With JQuery UI 1.10.3, the resulting div after a resize is one pixel too small in both directions.

by Emre

HTML

<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css">
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<div class="resize">
resize helper
</div>


<svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" version="1.1" width="800" height="420" id="svg">
    <image height="120" width="120" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://designpieces.com/wp-content/uploads/2013/04/chrome.png" ></image>
</svg>

CSS

.resize{
  height: 120px;
  width: 120px;
  position:absolute;
  z-index:0;
}

JavaScript

$('.resize').draggable().resizable({
    ghost: true,
    resize: function( event, ui ) {
    	var width = ui.size.width;
      var height = ui.size.height;
      $('image').attr('width',width);
      $('image').attr('height',height);
    }
            });
            
var position = $('svg').position();
$('.resize').css('top',position.top);
$('.resize').css('left',position.left);