简体   繁体   English

卡翻转旋转在iOS中不起作用

[英]Card flip rotation isn't working in iOS

I have these card-like images on my site, with an image on one side and text on the other side. 我的网站上有这些类似卡片的图片,一面为图片,另一面为文字。 They worked as planned on iOS until recently, but for some reason something changed and now they don't. 直到最近,他们仍按计划在iOS上工作,但由于某些原因,有些变化了,现在却没有。 The html is below: 的HTML如下:

<div class="widephoto card border">
<div class="side" id="bgimg1"></div>
<div class="side back darkbackground">
<p class="bio">Some Text</p>
</div>

and here's the css: 这是CSS:

.card {
  height: 100%;
  float:left;
  transform-style: preserve-3d;
  transition: all 1s ease-in-out;
  width: 100%;
  margin: auto;
}

.card:hover {
  transform: rotateY(180deg);
}

.card .side {
  -webkit-backface-visibility: hidden;
                 backface-visibility: hidden;
  height: 100%;
  position: absolute;
  width: 100%;
  overflow: hidden;
}

.card .back {
  transform: rotateY(180deg);
  -webkit-box-sizing: border-box;
       -moz-box-sizing: border-box;
                  box-sizing: border-box;
}

.bio{
    margin: 0;
    padding: 10px;
}

.widephoto{
    height: 234px;
    width: 314px;
    display: block;
    position: relative;
}

It turns out that iOS will not do the ol' spin move with a div that is only a background image. 事实证明,iOS不会使用仅作为背景图像的div进行旋转旋转。 I had to put an image in the divs instead of just setting the image as the background. 我不得不在div中放置图片,而不仅仅是将图片设置为背景。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM