views:

1811

answers:

1
+14  A: 

They're using a combination of CSS and JavaScript. The flip animation is powered by a CSS Sprite-like technique.

First of all, they have a very tall image called filmstrip.png that contains every flip "state" for each number (0 to 9; have a look at a scaled-down detail and you'll see what I mean).

Then, in the HTML, each digit is made up of three nested elements:

  • The first is a container element, which has its width and height set to the dimensions of a single flip "state", and its overflow set to hidden. This element is positioned relatively.

  • The second element is positioned absolutely (and because the first element is positioned relatively, this second element is positioned absolutely relative to the first element).

  • The third element has its background-image set to filmstrip.png, and its width and height set to the dimensions of this image.

The JavaScript then seems to rapidly change the top property of the second element, causing different parts of filmstrip.png to be exposed one after another, thus resulting in a flip animation.

Steve

Steve Harrison
Are you Steve Jobs? ;-)
Tim Büthe
No, but I do have Safari 4's Web Inspector (http://www.apple.com/safari/features.html#developer)...
Steve Harrison