Doing it with style
Now that Firefox supports the 3D transform styles we can use this and a little transition animation to create a dropdown menu with an unfolding sub menu.
This menu has 3D unfolding sub list with animation. Just hover the top level link to see this in Firefox, Safari and Chrome.
If you examine the code you will see that it uses nothing more than a set of nested divs and a simple structure to the stylesheet to give each div a transform origin relative to its parent div. In this way the parent divs controls the position and animation of their children.
Using this method the animation is just a simple style which is actioned on hovering the top level tab:
.concertina:hover div {
-webkit-transform:perspective(350px) rotateX(0deg);
-o-transform:perspective(350px) rotateX(0deg);
transform: perspective(350px) rotateX(0deg);
}
6th February 2013
Code and stylesheet changed to remove the need for the style preserver-3d so that the menu works in IE10. Also added 'onclick=""' to the page outer div so that it also works on the ipad etc. and finally added alternative fallback styles so that this works as a simple dropdown menu in IE9 and lower and also Opera which does not yet support 3d transforms.
Because of all the time and effort spent in producing this demonstration I would ask that you respect my copyright.
This demonstration can be used subject to the following terms and conditions.
Your donations keep CSS PLAY running.
If your donation is for the use of a demo then please email me with the demo url after making your donation.