2
我正在嘗試在Internet Explorer 11中使用CSS翻轉卡。我已閱讀其他問題,解決方案是爲翻轉卡功能添加'-ms'前綴。我已經做到了這一點,但在IE 11中,由於某些原因翻轉卡不顯示背面。CSS翻轉卡Internet Explorer問題
http://jsbin.com/hazejuzezu/1/edit?html,css,js,output
任何幫助極大的讚賞。
HTML代碼
<div class="flip y-theme-icon-wrapper">
<div class="card text-center">
<div class="face front">
<div class="y-theme-icon">
<img src="http://i.kinja-img.com/gawker-media/image/upload/s--4bKbxQOb--/1036281511469286726.jpg" height="90" alt="">
</div>
</div>
<div class="face back">
<br><p>More information about this subject.</p>
</div>
</div>
</div>
CSS代碼:
.y-theme-icon-wrapper{
width: 140px;
height: 140px;
}
.y-theme-icon {
display: block;
width: 140px;
height: 140px;
background: @color-1;
border-radius: 70px;
-webkit-border-radius: 70px;
-moz-border-radius: 70px;
-o-border-radius: 70px;
text-align:center;
}
.flip .card .back{
background-color: #fff;
}
.flip {
-webkit-perspective: 800;
-ms-perspective: 800;
-moz-perspective: 800;
-o-perspective: 800;
position: relative;
margin: 12px auto;
height: 100px;
z-index: 1;
position: relative;
}
.flip .card.flipped {
transform:rotatey(-180deg);
-ms-transform:rotatey(-180deg); /* IE 9 */
-moz-transform:rotatey(-180deg); /* Firefox */
-webkit-transform:rotatey(-180deg); /* Safari and Chrome */
-o-transform:rotatey(-180deg); /* Opera */
}
.flip .card {
-webkit-transform-style: preserve-3d;
-webkit-transition: 0.5s;
-moz-transform-style: preserve-3d;
-moz-transition: 0.5s;
-ms-transform-style: preserve-3d;
-ms-transition: 0.5s;
-o-transform-style: preserve-3d;
-o-transition: 0.5s;
transform-style: preserve-3d;
transition: 0.5s;
}
.flip .card .face {
position: absolute;
z-index: 2;
text-align: center;
backface-visibility: hidden; /* W3C */
-webkit-backface-visibility: hidden; /* Safari & Chrome */
-moz-backface-visibility: hidden; /* Firefox */
-ms-backface-visibility: hidden; /* Internet Explorer */
-o-backface-visibility: hidden; /* Opera */
}
.flip .card .front {
position: absolute;
z-index: 1;
cursor: pointer;
}
.flip .card .back {
color: black;
cursor: pointer;
transform:rotatey(-180deg);
-ms-transform:rotatey(-180deg); /* IE 9 */
-moz-transform:rotatey(-180deg); /* Firefox */
-webkit-transform:rotatey(-180deg); /* Safari and Chrome */
-o-transform:rotatey(-180deg); /* Opera */
}
/* Postcard */
.postcard-flip {
-webkit-perspective: 800;
-ms-perspective: 800;
-moz-perspective: 800;
-o-perspective: 800;
position: relative;
height: 500px;
z-index: 1;
position: relative;
}
.postcard-flip .card.flipped {
transform:rotatey(-180deg);
-ms-transform:rotatey(-180deg); /* IE 9 */
-moz-transform:rotatey(-180deg); /* Firefox */
-webkit-transform:rotatey(-180deg); /* Safari and Chrome */
-o-transform:rotatey(-180deg); /* Opera */
}
.postcard-flip .card {
-webkit-transform-style: preserve-3d;
-webkit-transition: 0.5s;
-moz-transform-style: preserve-3d;
-moz-transition: 0.5s;
-ms-transform-style: preserve-3d;
-ms-transition: 0.5s;
-o-transform-style: preserve-3d;
-o-transition: 0.5s;
transform-style: preserve-3d;
transition: 0.5s;
}
.postcard-flip .card .face {
position: absolute;
z-index: 2;
text-align: center;
backface-visibility: hidden; /* W3C */
-webkit-backface-visibility: hidden; /* Safari & Chrome */
-moz-backface-visibility: hidden; /* Firefox */
-ms-backface-visibility: hidden; /* Internet Explorer */
-o-backface-visibility: hidden; /* Opera */
}
.postcard-flip .card .front {
position: absolute;
z-index: 1;
cursor: pointer;
}
.postcard-flip .card .back {
color: black;
cursor: pointer;
transform:rotatey(-180deg);
-ms-transform:rotatey(-180deg); /* IE 9 */
-moz-transform:rotatey(-180deg); /* Firefox */
-webkit-transform:rotatey(-180deg); /* Safari and Chrome */
-o-transform:rotatey(-180deg); /* Opera */
}
JS代碼:
$(document).ready(function() {
/* Card flip */
$(".flip").hover(function(){
$(this).find(".card").toggleClass("flipped");
return false;
});
});
你看到背面? (有關主題文本的更多信息的白色方塊) – dutchman711
哈利 - 當然會的。謝謝你的幫助。 – dutchman711
檢查[this](http://jsbin.com/gajofawega/2/edit)是否適合你。它在IE11中適用於我,但會帶來非常不好的效果。 [這](http://stackoverflow.com/questions/25104850/flipping-card-issue/25105063#25105063)是我前面寫的一個不同的答案,與這個問題鬆散地相關。你可能會覺得它很有用。 – Harry