我想實現一個翻轉卡效果點擊一個按鈕,但我不能完全弄清楚的Javascript。我其實對JavaScript一無所知,所以我試圖找到類似的解決方案,並根據我的需要改變它們,但沒有結果。下面是CSS如何作爲:hover
風格。在點擊Javascript變換
你可以在這裏查看:http://dangoodeofficial.co.uk/290-2
CSS:
.flip3D {
float: left;
display: block;
position: relative;
width: auto;
height: 675px;
}
.flip3D .front {
position: absolute;
-o-transform: perspective(600px)RotateY(0deg);
-moz-transform: perspective(600px)RotateY(0deg);
-ms-transform: perspective(600px)RotateY(0deg);
-webkit-transform: perspective(600px)RotateY(0deg);
transform: perspective(600px)RotateY(0deg);
-o-transform-backface-visibility: hidden;
-moz-transform-backface-visibility: hidden;
-ms-transform-backface-visibility: hidden;
-webkit-transform-backface-visibility: hidden;
backface-visibility: hidden;
transition: -o-transform .5s linear 0s;
transition: -moz-transform .5s linear 0s;
transition: -ms-transform .5s linear 0s;
transition: -webkit-transform .5s linear 0s;
transition: transform .5s linear 0s;
width: 100%;
}
.flip3D .back {
position: absolute;
-o-transform: perspective(600px)RotateY(180deg);
-moz-transform: perspective(600px)RotateY(180deg);
-ms-transform: perspective(600px)RotateY(180deg);
-webkit-transform: perspective(600px)RotateY(180deg);
transform: perspective(600px)RotateY(180deg);
-o-transform-backface-visibility: hidden;
-moz-transform-backface-visibility: hidden;
-ms-transform-backface-visibility: hidden;
-webkit-transform-backface-visibility: hidden;
backface-visibility: hidden;
transition: -o-transform .5s linear 0s;
transition: -moz-transform .5s linear 0s;
transition: -ms-transform .5s linear 0s;
transition: -webkit-transform .5s linear 0s;
transition: transform .5s linear 0s;
width: 100%;
}
.flip3D:hover > .front {
-o-transform: perspective(600px)RotateY(-180deg);
-moz-transform: perspective(600px)RotateY(-180deg);
-ms-transform: perspective(600px)RotateY(-180deg);
-webkit-transform: perspective(600px)RotateY(-180deg);
transform: perspective(600px)RotateY(-180deg);
}
.flip3D:hover > .back {
-o-transform: perspective(600px)RotateY(0deg);
-moz-transform: perspective(600px)RotateY(0deg);
-ms-transform: perspective(600px)RotateY(0deg);
-webkit-transform: perspective(600px)RotateY(0deg);
transform: perspective(600px)RotateY(0deg);
}
而且我有帶班.flip-button
正面和.flip-back
的後退按鈕。
任何意見將不勝感激。謝謝。
丹
也在這裏發佈您的相關HTML和JavaScript。 – dowomenfart