HTML+Programming for animation best practices? absolute or relative positioning?

1 points by mc_hammer ↗ HN
So I'm doing some animation for my next HTML web app, what do you all find works best for things that have to be animated?

Absolute positioning: Seems to work best for animation, but dealing with things like parent.offset() is really annoying. Furthermore for every sprite change or tweak i feel like i have to go edit 5-10 x,y points in my code And in my css. Hit testing is also a pain with abs positioning.

Relative positioning: Easiest to work with, pita to animate because moving the object to abs positioning breaks the flow and moves evertying. also a pain because of things like jquery position() doesnt give you screenX/Y or is there a solution for that.

What best practices do you use for seting up the DOM to make life easier for animations?

Fwiw, I'm mostly doing UI animation similar to a desktop app, overlay sprites moving from one elem to another, dialogs sliding in and out, and fun things like bouncing drop down text. Juice it anyone?

0 comments

[ 4.5 ms ] story [ 20.8 ms ] thread

No comments yet.