これは、私がやろうとしていることのフィドルの例です。
クリック時に 2 つの div を回転させるために、jQuery トランジットと CSS3 3D トランジションが使用されています。フィドルを見ると、「回転」をクリックするとdivのパースペクティブが変更されるため、「回転バック」が表示されます。ファンキーな z-indexing またはポジショニングが行われているように見えるため、'rotate back' はクリックできません。
HTML
<div class="masthead">
<div class="face face-1"><span class="rotate">rotate</span></div>
<div class="face face-2"><span class="rotate-back">rotate back</span>
</div>
JS
$(document).ready(function () {
$(".rotate").click(function () {
$(".masthead").transition({
perspective: '0',
rotateX: '90deg',
duration: 250
});
});
$(".rotate-back").click(function () {
$(".masthead").transition({
perspective: '0',
rotateX: '-90deg',
duration: 250
});
});
});
CSS
.masthead {
-webkit-animation-timing-function: ease-in-out;
-webkit-transform-style: preserve-3d;
-webkit-transform-origin: 22px 22px 0;
}
.masthead .face {
height: 44px;
position: absolute;
width: 100%;
}
.masthead .face-1 {
background: red;
-webkit-transform: translateZ(22px);
}
.masthead .face-2 {
background: aqua;
-webkit-transform: rotateX(-90deg) translateZ(22px);
}
どんな助けでも大歓迎です、ありがとう!