Note that there are some explanatory texts on larger screens.

plurals
  1. POCSS Flipping Cube
    primarykey
    data
    text
    <p>I made some expriment with CSS3. I wanted to build a Flipping Cube with only 2 DIV.Like this: <a href="http://cssdeck.com/labs/css3-flipping-cube" rel="nofollow">http://cssdeck.com/labs/css3-flipping-cube</a> (I dont like this solution because the div must always be centered) So I have tried to find my own solution. My HTML structure looks like this:</p> <pre><code>&lt;div class="outer"&gt; &lt;div class="face face1"&gt;Click here !&lt;/div&gt; &lt;div class="face face2"&gt;&lt;/div&gt; &lt;/div&gt; </code></pre> <p>My CSS file looks like this:</p> <pre><code>.outer { margin-left:52px; position:relative; width:400px; perspective:500px; } .face { width:100%; height:50px; padding:0 10px; background-color:#E5E5E5; position:absolute; } .face.face1 { height:50px; background-color:#E5E5E5; transform:rotateX(0deg); transform-origin:0 0 0; z-index:1; top:0; } .face.face2 { height:50px; background-color:#007CC1; transform:rotateX(-90deg); transform-origin:0 50px 0; z-index:3; top:0; } .face.face1.start { transform:rotateX(90deg); transition:transform 1s ease-out; } .face.face2.start { transform:rotateX(0deg); transition:transform 1s ease-out; } </code></pre> <p>When I click on the <code>face1</code> then javascript adds the class start to the divs for are the animation.</p> <pre><code>$(function(){ $('.outer').on('click', function(){ $('.face1').addClass('start'); $('.face2').addClass('start'); }); }); </code></pre> <p>My solution looks currently not good. Do you have any tips or idea for me. You can see the whole code here:</p> <p><a href="http://jsfiddle.net/dAXRX/3/" rel="nofollow">http://jsfiddle.net/dAXRX/3/</a></p> <p>(I didn't use the <code>-webkit</code> prefix. It currently only works with Firefox)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload