我正在尝试做的事情的Here is an example fiddle。
正在使用jQuery中转和CSS3 3D过渡,以便在单击时旋转2个div。如果你看一下小提琴,点击“旋转”将改变div上的透视,所以“旋转回来”显示。“转回”是不能点击的,因为似乎有一些时髦的z索引或定位正在进行。
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);
}如有任何帮助,将不胜感激,谢谢!
发布于 2013-04-26 06:11:18
红色是蓝色的,反之亦然。使用指针事件来允许点击到达目标元素。
$('.face-1').css('pointer-events', 'none');
$('.face-2').css('pointer-events', '');这就是你所想的:http://jsfiddle.net/e344M/14/
https://stackoverflow.com/questions/15735816
复制相似问题