Consider following code:

What I do here is pretty basic:

#1. Put width and height of the hovered image in the variable.
#2. Calculate 10% increase of each parameter.
#3. Calculate amount of pixels image should be moved left and top to keep it centered.
#4. Plug this variables in animate().

As far as css goes, nothing fancy here either. I use position absolute on image to completely remove it from the document flow. Thus freeing browser from the burden of recalculating position of all elements.

..and it should be a smooth sailing…

But no, result is absolutely hideous. I would never use animation like this in any of my projects, especially when I spend so much time on getting the design perfect. Please check this demonstration I prepared for you, and don’t forget to see it in firefox, it is especially jittery there.

Leave a Reply

Your email address will not be published. Required fields are marked *