我設置了卡片翻轉功能,用戶可以看到卡片的背面,單擊並拖動它,然後單擊一個熱點(此處爲黑色條),將會然後翻轉卡片。CSS卡片翻轉不顯示背面
它所有的工作,除了它顯示卡背面的部分。翻轉動畫發生,它只是空白。
任何幫助將不勝感激!
下面是我在哪裏...
Here's a fiddle with functionality.
HTML
<div id="flipStage">
<div class="card" id="bsg">
<div class="front" id="bsgFront"></div>
<div class="back" id="bsgBack"></div>
<div class="flipButton"></div>
<div class="handle"></div>
</div>
</div>
CSS
.flipStage {
position: relative;
float: left;
width:100%;
height:100%;
}
.card {
cursor: pointer;
height:175px;
width:125px;
position:absolute;
-webkit-transition: -webkit-transform .5s;
-moz-transition: -moz-transform .5s;
-o-transition: -o-transform .5s;
transition: transform .5s;
-webkit-transform-style: preserve-3d;
-moz-transform-style: preserve-3d;
-o-transform-style: preserve-3d;
transform-style: preserve-3d;
-webkit-perspective: 300px;
-moz-perspective: 300px;
-o-perspective: 300px;
perspective: 300px;
}
.flipped {
-webkit-transform:rotateY(180deg);
-moz-transform:rotateY(180deg);
-o-transform:rotateY(180deg);
transform:rotateY(180deg);
}
.card .front, .card .back {
display: block;
position:absolute;
height:100%;
width:100%;
-webkit-backface-visibility:hidden;
-moz-backface-visibility:hidden;
-o-backface-visibility: hidden;
backface-visibility:hidden;
}
#bsg {
top:150px;
left:150px;
}
#bsgFront {
background-image:url(http://images.penguinmagic.com/images/products/original/8006b.jpg);
background-repeat:no-repeat;
background-size: 100%;
}
#bsgBack {
background-image:url(http://images2.fanpop.com/image/photos/9400000/Tricia-Helfer-BSG-Promotional-Photography-tricia-helfer-9422601-1089-1450.jpg);
background-repeat:no-repeat;
background-size: 100%;
}
.flipButton {
height: 20px;
width: 100%;
position: absolute;
top:0;
right:0;
background-color:black;
}
.handle {
position:absolute;
width: 100%;
height: 100%;
top: 20px;
}
它看起來像你翻轉卡。所有的內容都在卡片的一面。 – Leeish
我有我的舞臺,卡片,然後正面和背面。那不正確的結構? – Layne
而你的形象不會進入正確的。在這裏我會發布。 – Leeish