Ticket #4316 (closed bug: fixed)
Element jumps to wrong position after "scale" effect with origin: ['middle','center'] parameter
| Reported by: | marteadrian | Owned by: | |
|---|---|---|---|
| Priority: | minor | Milestone: | 1.9.0 |
| Component: | ui.effects.* (individual effect) | Version: | 1.7 |
| Keywords: | scale effect ui | Cc: | |
| Blocking: | Blocked by: |
Description
Code:
$(document).ready(function(){
$('.scale').click(function() {
$(this).effect("scale",
{percent:200, origin: ['middle','center']},
1000);
});
});
the element resizes well, but after the transition (and before the
callback function executes) the element jumps back to it's original
(unresized) position. (the left and top position changed because of
the origin [middle,center] parameter).
You can see an example here: http://neu.optiongolf.com/fileadmin/templates/test.html
Change History
comment:2 Changed 3 years ago by AzaToth
can confirm this; I would recommend bumping severity, as currently it's impossible to enlarge stuff with non top/left gravity
comment:4 Changed 2 years ago by dclawson
A temporary fix I have found is to remove the 'restore' function call after the effect has been performed.
Remove this block of code from the end of the Scale function:
c.effects.restore(a, n?e:g);
A top and left css property is also added to the element. Simply place some jquery css on the effect callback to prevent this:
$('#element').css('top', '0').css('left', '0');
comment:5 Changed 2 years ago by tomykaira
https://github.com/tomykaira/jquery-ui/commit/ca8d70dbbf9eff0057cf67f695e66b8c40cec09b
Here is a clean patch for this issue. I add new top and left in el.to object.
comment:6 Changed 2 years ago by gnarf
- Status changed from open to closed
- Resolution set to fixed
Effects.scale: Update the position of the element post animation to avoid jumping - Fixed #4316 - Element jumps to wrong position after scale effect with origin: ['middle','center'] parameter
Changeset: c1f71f1c2f732e58a8fbca91185a284ea8db6b1b

