Skip to content

Instantly share code, notes, and snippets.

@brandonkelly
Created March 2, 2009 16:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brandonkelly/72850 to your computer and use it in GitHub Desktop.
Save brandonkelly/72850 to your computer and use it in GitHub Desktop.
// What I did
$myField.resizable({
handles: ['.ui-resizable-handle'], // I already have this as a jQuery object, but passing it threw an error
alsoResize: '#'+myFieldId+' .scrollPane', // No way to specify the containment, so I had to add prepend the field ID. (allowing a jQuery object would fix that as well)
containment: 'parent', // This keeps the width from getting wider
resize: function() {
$(this).width('100%'); // This keeps the width from getting narrower
$('.scrollPane', this).width('100%'); // This keeps the alsoResize elements from changing widths
}
});
// What I should have been able to do
$myField.resizable({
handles: $myResizeHandle, // since jQuery objects can contain multiple elements, no array should be needed if passing one
alsoResize: $('.scrollPane', $myField), // much cleaner and scablable
axis: 'y' // replaces my 'containment' option and 'resize' event
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment