resize: function(e, ui) {\r
var o = ui.options, self = $(this).data("resizable"), cs = self.size, os = self.originalSize, op = self.originalPosition, a = self.axis, ratio = o._aspectRatio || e.shiftKey;\r
o.grid = typeof o.grid == "number" ? [o.grid, o.grid] : o.grid;\r
- var ox = Math.round((cs.width - os.width) / o.grid[0]) * o.grid[0], oy = Math.round((cs.height - os.height) / o.grid[1]) * o.grid[1];\r
+ var ox = Math.round((cs.width - os.width) / (o.grid[0]||1)) * (o.grid[0]||1), oy = Math.round((cs.height - os.height) / (o.grid[1]||1)) * (o.grid[1]||1);\r
\r
if (/^(se|s|e)$/.test(a)) {\r
self.size.width = os.width + ox;\r