When the div βflipsβ, I would like to be able to click the link, how can I achieve this?
Apparently, I need to write some more text, or it will not allow me to post this question, who will drink later?
CSS
.flip-container {
perspective: 1000;
}
.flip-container:hover .flipper, .flip-container.hover .flipper {
transform: rotateY(180deg);
}
.flip-container, .front, .back {
width: 320px;
height: 200px;
}
.flipper {
transition: 0.6s;
transform-style: preserve-3d;
position: relative;
}
.front, .back {
backface-visibility: hidden;
position: absolute;
top: 0;
left: 0;
}
.front {
z-index: 2;
background-color: red;
}
.back {
transform: rotateY(180deg);
background-color: green;
}
HTML:
<div class="flip-container" ontouchstart="this.classList.toggle('hover');">
<div class="flipper">
<div class="front">
Front
</div>
<div class="back">
<a href="http://www.google.com">Click me</a>
</div>
</div>
</div>
http://jsfiddle.net/iwasdavid/1qv7bLpo/
source
share