0
$('#foo').resizable({
   resize:function(){}
});

Question

  1. This creates a east/south handle, how do you create a east/west?
  2. By changing the south class (ui-resizable-s) to the west class (ui-resizable-w) -current debug workaround-, the west does not behave like the east. When the east is dragged, the element is expanded. When the west is dragged, the element is expanded but a left positioning is also applied.

Any ideas?

vol7ron
  • 40,809
  • 21
  • 119
  • 172

1 Answers1

2

From the manual :

handles

Type: String, Object Default: 'e, s, se'

If specified as a string, should be a comma-split list of any of the following: 'n, e, s, w, ne, se, sw, nw, all'. The necessary handles will be auto-generated by the plugin.

If specified as an object, the following keys are supported: { n, e, s, w, ne, se, sw, nw }. The value of any specified should be a jQuery selector matching the child element of the resizable to use as that handle. If the handle is not a child of the resizable, you can pass in the DOMElement or a valid jQuery object directly. Code examples

Initialize a resizable with the handles option specified.

$( ".selector" ).resizable({ handles: 'n, e, s, w' });
Shikiryu
  • 10,180
  • 8
  • 49
  • 75
  • +1, I looked at the manual, but must have missed this, thank you. Now I have to test the 'w' behavior, because I don't want it to set the `left` position in addition to the width. – vol7ron Nov 12 '10 at 21:05
  • Yep, still no good, any ideas on how to turn off the left positioning? I'm probably missing it in the options, and I hope not to add a callback. – vol7ron Nov 12 '10 at 21:15
  • 1
    @vol7ron : I don't really understand your problem with the left positioning you want (or not :S) . Is this solving your issue : http://www.jsfiddle.net/bADLt/1/ ? – Shikiryu Nov 15 '10 at 10:01
  • @Chouchenos: the `ui.position.left = ui.originalPosition.left;` is exactly what I needed. You can see what was happening [here](http://www.jsfiddle.net/bADLt/2/) - notice that the right side works, but the left side doesn't. – vol7ron Nov 15 '10 at 16:45
  • @vol7ron : yeah, I supposed it was that but I wasn't sure. Glad you got it right now :) – Shikiryu Nov 15 '10 at 16:47
  • The only follow-up I have is, how would you increase the width by 2? When it's centered like that, it's expanding correctly, but it looks like it's only moving half because it is centered. I can open a new question if you want :) – vol7ron Nov 15 '10 at 17:06
  • I opened up the question [here](http://stackoverflow.com/questions/4186977/jquery-resizable-doubling-the-resize-width) – vol7ron Nov 15 '10 at 17:18