Pew Pew Laser Blog

Code. Glass art. Games. Baking. Cats. From Seattle, Washington and various sundry satellite locations.

Pew Pew Laser Blog Archives — by Blog ID

Smooth Animation Using jQuery's slideToggle() - Details.

5.6.2009

I have written a more detailed description of the solution I found to jQuery's jumpy animations in Pew Pew Laser Articles. Though I'm working with the slideToggle() function, I bet the solution would fix similar cases using animate(), show(), hide() and other animation functions.

Essentially, the solution works by storing the heights of animating elements before they are hidden, and then re-applying those heights just before starting the animations. I'm pretty proud using the array and jQuery's each() function to simplify the grunt work of storing and re-applying the heights. It may well be my best JavaScript work.

Permalink

Tags: javascript jquery web-development

Authorized users may log-in to leave a comment.

Last Blog: Still Employed.

Next Blog: A Transition.