It seems you've found a bug when animate is set to true, which uses a helper
for resizing. The stop event is actually firing at the right time, at
mouseup that ends the resize drag. The problem is the original element size
is being reported in the stop event by ui.size, and as you've noted, it
hasn't been resized yet. The animation to resize it occurs after stop. The
helper size is what you need. It really should be in ui.size, as the
original element size is already available in ui.originalSize. Interesting
though that the helper size is reported correctly in the resize event
(ui.size.width, ui.size.height). Workaround:
$(obj).resizable({
stop: function(event, ui) {
alert(ui.helper.width() + " : " + ui.helper.height());
},
handles: "all",
animate: true
});
- Richard
On Thu, Aug 6, 2009 at 1:38 PM, Neil <[email protected]> wrote:
>
> Problem is the resizable callback is called before the element is
> resized, and before the position and size properties are updated. This
> makes it so that any callback that wants to respond to a resize event
> is always one step behind, since it gets the before value instead of
> the after value.
>
> My code below alerts the size properties as was before the element is
> resized. Ideas?
>
>
> $(obj).resizable({
> stop: function(event, ui) {
> alert(ui.size.width + " : " + ui.size.height);
> },
> handles: "all",
> animate: true
> });
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jQuery UI" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/jquery-ui?hl=en
-~----------~----~----~----~------~----~------~--~---