Created
March 2, 2009 16:47
-
-
Save brandonkelly/72850 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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