Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Door opening 3D effect in CSS

Tags:

css

3d

I'm trying to create a "door opening" 3D effect in CSS but I just can't do it. The problem is that using rotateY() function makes the element spin. You can check it here http://jsfiddle.net/uC4du/1/

Do you know how to change the rotateY "reference axis"? What should I do to make the element rotate using its left corners as reference?

like image 599
Eduardo Cobuci Avatar asked Jan 13 '12 15:01

Eduardo Cobuci


1 Answers

You can use 'transform-origin' property ( http://www.w3schools.com/cssref/css3_pr_transform-origin.asp ).

Set it to something like: "-webkit-transform-origin: 0% 50%;"

Here is your example using that property: http://jsfiddle.net/aV76H/

Hope it helps!

like image 89
Francisco Paulo Avatar answered Nov 02 '22 23:11

Francisco Paulo