div shifts after jquery scale effect

Deadly 提交于 2019-12-06 05:37:14

问题


I have a div that after scaling, shifts to the left and down and I can't see why this is happening. See http://jsfiddle.net/7A7gs/2 for all code.

I've tried using animate width/height instead of scale, and the same thing happens. I've also tried size instead of scale. Same thing.

Also, if I change the scale from 'both' to vertical, the div does not shift. If I change the scale to 'horizontal' the div shifts.

Please let me know where I'm going wrong here! MTIA.

EDIT: The desired behaviour is that the clicked div shifts to the top left corner of the window (this is currently working correctly), then expands to fill the width and height of the window.

Currently, it expands to fill the width and height of the window and then shifts downward and to the left, which is not the desired behaviour.


回答1:


this is a known bug, please read here for a quick fix and a solution: Element jumps to wrong position after "scale" effect




回答2:


In the end, it appears that the offset positioning was causing the problem. I changed the code to switch between relative and absolute positioning and the animation stopped jumping.



来源:https://stackoverflow.com/questions/6434354/div-shifts-after-jquery-scale-effect

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!