Card back hidden on first transition in chrome

最后都变了- 提交于 2020-02-25 13:13:13

问题


I'm developing a generic card that displays various content on the front and back. The card flips 180 degrees on a click.

In Chrome, when I have content on the back that contains absolute or relative positioning, the back of the card only becomes visible at (or near) the end of the transition.

In Safari and Firefox I don't see the same issue.

The issue can be seen in this pen https://codepen.io/rumbletumble/pen/GRgNeLg

I've tried

  • Using animation rather than transition, but the same issue exists
  • Adding backface-visibility: visible to the card back, but this causes flickering on the card

Could this simply be a bug in Chrome?


回答1:


I have change the below class and it now seems to be working fine across all browsers. (wan't able to test IE)

/* hide back of pane during swap */
.front, .back {
  -webkit-backface-visibility: hidden;
  -moz-backface-visibility: hidden;
  -ms-backface-visibility: hidden;
  backface-visibility: hidden;

  transform: rotateX(0deg);
  transform-style: preserve-3d;

  position: absolute;
  top: 0;
  left: 0;
  color: cornSilk;
  text-align: center;
  font: 3em/240px 'Helvetica Neue', Helvetica, sans-serif;
  box-shadow: -5px 5px 5px #aaa;
}


来源:https://stackoverflow.com/questions/59379794/card-back-hidden-on-first-transition-in-chrome

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!