Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I've made another modification. It turns out that Chrome needs a transform on the non-hovered element in order to position it while hovering.</p> <p>jsfiddle: <a href="http://jsfiddle.net/jjordanca/NYpbS/2/" rel="nofollow">http://jsfiddle.net/jjordanca/NYpbS/2/</a></p> <p><strong>HTML</strong></p> <pre><code>&lt;ul id="email"&gt; &lt;li&gt; &lt;div class="green" style="width:180px;height:180px;background-color:green"&gt;&lt;/div&gt; &lt;div class="red" style="width:250px;height:200px;margin-left:5px;background-color:red"&gt;&lt;/div&gt; &lt;/li&gt; &lt;/ul&gt; </code></pre> <p><strong>CSS</strong></p> <pre><code>#email { list-style:none; margin:100px 0; height:550px; } #email li{ display: block; -webkit-perspective: 500px; -moz-perspective: 500px; position: relative; width: 100%; height: 100%; -moz-transform-origin: 25% 50%; -webkit-transform-origin: 25% 50%; } #email:hover .green { -webkit-transform-style: preserve-3d; -moz-transform-style: preserve-3d; -webkit-transform: translate3d(100px,0,175px); -moz-transform: translate3d(100px,0,175px); -webkit-transition-property: transform; -webkit-transition-duration: 1s; -moz-transition-property: transform; -moz-transition-duration: 1s; z-index: 2; } #email:hover .red { -webkit-transform-style: preserve-3d; -moz-transform-style: preserve-3d; -webkit-transform: translate3d(0, 0, -175px); -moz-transform: translate3d(0, 0, -175px); -webkit-transition-property: transform; -webkit-transition-duration: 1s; -moz-transition-property: transform; -moz-transition-duration: 1s; z-index: 1; } #email li div { display: block; position: absolute; -moz-box-shadow:0 3px 10px #888; -webkit-box-shadow:0 3px 10px #888; } #email li .green { -webkit-transform-style: preserve-3d; -moz-transform-style: preserve-3d; -webkit-transform: translate3d(50px, -50px, -50px); -moz-transform: translate3d(50px, -50px, -50px); z-index: 1; } #email li .red { -webkit-transform-style: preserve-3d; -moz-transform-style: preserve-3d; -webkit-transform: translate3d(150px, 50px, 50px); -moz-transform: translate3d(150px, 50px, 50px); z-index: 2; } </code></pre>
    singulars
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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