2

我在 safari 的代码遇到了一个奇怪的问题。
我创建了一个 jsbin,问题也在那里:http: //jsbin.com/aseced/8/edit

Safari 版本:5.1.7

你能看看吗?谢谢

TJL

编辑:

鼠标悬停时,标题应该下降(css3 rotateX 和透视)。但只有第一个动画它纠正了所有其他的只是显示(如显示:块 - 无)

这是我在 JSBin 上演示的代码:(我只是将鼠标悬停时打开的类添加到文章中)HTML:

<article class="tile2x1">
  <img src="http://www.placehold.it/460x220" />
  <section class="caption" style="background-color: #">         
    <header>
      <h5>www.opten.ch</h5>
    </header>
    <a href="http://opten.ch" title="www.opten.ch">
      www.opten.ch
    </a>
  </section>
</article>
<article class="tile2x1">
  <img src="http://www.placehold.it/460x220" />
  <section class="caption" style="background-color: #">         
    <header>
      <h5>www.opten.ch</h5>
    </header>
    <a href="http://opten.ch" title="www.opten.ch">
      www.opten.ch
    </a>
  </section>
</article>
<article class="tile2x1">
  <img src="http://www.placehold.it/460x220" />
  <section class="caption" style="background-color: #">         
    <header>
      <h5>www.opten.ch</h5>
    </header>
    <a href="http://opten.ch" title="www.opten.ch">
      www.opten.ch
    </a>
  </section>
</article>

CSS:

[class*="tile"] {
  margin: 10px;
  position: relative;
  float: left;
  background-color: #e53b24;
}

.tile2x1 {
  height: 220px;
  width: 460px;
}

[class*="tile"] > section.caption {
  padding-top: 20px;
  width: 100%;
  position: absolute;
  top: 0px;
  left: 0px;
  background-color: #7ab73e;
  display: inline-block;

  transform-origin: top;
  -o-transform-origin: top;
  -moz-transform-origin: top;
  -webkit-transform-origin: top;

  transform: perspective( 600px ) rotateX( -91deg );
  -o-transform: perspective( 600px ) rotateX( -91deg );
  -moz-transform: perspective( 600px ) rotateX( -91deg );
  -webkit-transform: perspective( 600px ) rotateX( -91deg );

  transition: all .15s linear;
  -o-transition: all .15s linear;
  -moz-transition: all .15s linear;
  -webkit-transition: all .15s linear;


  backface-visibility: hidden;
  -webkit-backface-visibility: hidden; /* Chrome and Safari */
  -moz-backface-visibility: hidden; /* Firefox */
  -ms-backface-visibility: hidden; /* Internet Explorer */
}

[class*="tile"].open > section.caption {
  transform: perspective( 600px ) rotateX( 0deg );
  -o-transform: perspective( 600px ) rotateX( 0deg );
  -moz-transform: perspective( 600px ) rotateX( 0deg );
  -webkit-transform: perspective( 600px ) rotateX( 0deg );
}


[class*="tile"] > section.caption header {
  padding-bottom: 5px;
  font-size: 18px;
  text-transform: uppercase;
  color: #fff;
  font-weight: 100;
  line-height: 22px;
  margin: 0 20px;
  border-bottom: 1px solid #fffffd;
}

[class*="tile"] > section.caption > a {
  margin: 0 20px;
  line-height: 34px;
  color: #fff;
  font-weight: bold;
  display: block;
}
4

1 回答 1

1

我设法通过将转换规则应用于目前需要这些转换的块来修复这个 Safari 特性。

不幸的是,就我而言,这是一堆通过滚动鼠标滚轮向左/向右移动的幻灯片,并且没有初始转换。它使您的情况有点复杂,因为当您为多个块指定转换时,Safari 显然不喜欢。

这是我编辑的您的 bin:我将变换规则从[class*="tile"] > section.caption移至[class*="tile"].open > section.caption并更改了旋转度,以便 PoC 可演示。

现在轮到您设计解决方案以使其按预期工作了。

于 2014-04-08T00:20:04.400 回答