<div class="flip-container" ontouchstart="this.classList.toggle('hover');">
="flipper">
="front">
<!-- 前面内容 -->
</div="back" 背面内容 >
>
/* entire container,keeps perspective */
.flip-container {
perspective: 1000;
}
flip the pane when hovered
.flip-container:hover .flipper,.flip-container.hover .flipper {
transform: rotateY(180deg);
}
.flip-container,.front,.back {
width: 320px;
height: 480px;
}
flip speed goes here
.flipper {
transition: 0.6s;
transform-style: preserve-3d;
position: relative;
}
hide back of pane during swap
.front,1)">
backface-visibility: hidden; absolute;
top: 0;
left: 0;
}
front pane,placed above back
.front {
z-index: 2;
}
back,initially hidden pane
.back {
transform: rotateY(180deg);
}
.flip-container:hover .flipper,.flip-container.hover .flipper,.flip-container.flip .flipper { rotateY(180deg);
}
.vertical.flip-container {
position: relative;
}
.vertical .back { rotateX(180deg);
}
.vertical.flip-container .flipper {
transform-origin: 100% 213.5px; 高的一半 */
}
.vertical.flip-container:hover .flipper { rotateX(-180deg);
}
1000; preserve-3d;
}
UPDATED! flip the pane when hovered
.flip-container:hover .back { rotateY(0deg);
}
.flip-container:hover .front { UPDATED! front pane,1)"> 2; rotateY(0deg);
}
rotateY(-180deg);
}
Some vertical flip updates
.vertical.flip-container {
.vertical.flip-container:hover .back { rotateX(0deg);
}
.vertical.flip-container:hover .front { rotateX(180deg);
}