Skip to main content

Search and Top Navigation

#4316 closed bug (fixed)

Opened March 10, 2009 02:34PM UTC

Closed June 14, 2011 08:13PM UTC

Last modified February 07, 2013 12:44PM UTC

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:
Blocked by: Blocking:
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

Attachments (0)
Change History (8)

Changed March 25, 2009 04:35PM UTC by scottgonzalez comment:1

milestone: TBD1.8

Changed May 03, 2010 08:04PM UTC by AzaToth comment:2

can confirm this; I would recommend bumping severity, as currently it's impossible to enlarge stuff with non top/left gravity

Changed March 14, 2011 05:56AM UTC by gnarf comment:3

status: newopen

Changed March 14, 2011 12:18PM UTC by dclawson comment:4

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'); 

Changed May 16, 2011 03:43AM UTC by tomykaira comment:5

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.

Changed June 14, 2011 08:13PM UTC by gnarf comment:6

resolution: → fixed
status: openclosed

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

Changed February 07, 2013 08:18AM UTC by dmack comment:7

this is NOT fixed, you can even see the repositioning in the above URL

Changed February 07, 2013 12:44PM UTC by scottgonzalez comment:8

@dmack It was fixed, but it regressed.