我在这个页面上有一个翻盖动画,https://muttcase.com.au/products/call-my-mum-shes-lost-without-me,它在除了safari之外的所有浏览器上都工作得很完美。我试过前缀,但我迷路了。使用的css im是..。
/* entire container, keeps perspective */
.product-single__photos {
perspective: 1000px;
}
.product-single__photos, .front, .back {
width: 320px;
height: 420px;
}
/* flip speed goes here */
.flipper {
transition: 0.6s;
transform-style: preserve-3d;
position: relative;
}
/* hide back of pane during swap */
.front, .back {
backface-visibility: hidden;
position: absolute;
top: 0;
left: 0;
}
/* front pane, placed above back */
.front {
z-index: 2;
/* for firefox 31 */
transform: rotateY(0deg);
}
/* back, initially hidden pane */
.back {
transform: rotateY(180deg);
}
.flippy .flipper, .product-single__photos.flippy .flipper, .product-
single__photos.flip .flipper {
transform: rotateY(180deg);
}
发布于 2017-10-09 16:53:34
为了让它在Safari中发挥作用,我解决了几个问题:
.front
元素为空。检查您的HTML,我假设您想要这样做,将#ProductImageWrapper...
元素放在.front
中。这可能是由于HTML中的语法问题或未关闭的<div>
标记造成的。.front
和.back
元素上都不需要使用.back
。您的代码示例不会以这种方式显示,但是您链接的站点上的代码会显示出来。然后,"Flip“按钮会落在元素后面,因为前面的兄弟姐妹中的所有元素现在都是(如您所期望的) position: absolute
。如果你对另一个问题有意见,可以继续发帖。
https://stackoverflow.com/questions/46656906
复制相似问题