简体   繁体   English

CSS3动画Buggy / Blinky

[英]CSS3 Animations Buggy/Blinky

So I'm working on this site: http://superfy.me and I have CSS3 transitions (currently only for Chrome) between the routes. 因此,我正在以下站点上工作: http : //superfy.me,并且在路由之间有CSS3过渡(当前仅适用于Chrome)。 Basically to perform the animation I do the following: 基本上,为了执行动画,我执行以下操作:

  1. Add the .preanimate class which rotates the phasing out div to rotateY(0deg) and the phasing in div to rotateY(180deg) 添加.preanimate类,该类将逐步淘汰div旋转到rotateY(0deg) ,将逐步淘汰div rotateY(180deg)rotateY(180deg)
  2. I add the .animate class which adds the -webkit-transition: -webkit-transform 0.5s; 我添加了.animate类,它添加了-webkit-transition: -webkit-transform 0.5s;
  3. I remove the .preanimate class which removes the rotated transforms 我删除了.preanimate类,它删除了旋转的变换

This is the css: 这是CSS:

#container,
 #animate-container {
   position: absolute;
   top: 70px;
   width: 100%;
   height: 100%;
   -webkit-transform-style: preserve-3d;
   -webkit-backface-visibility: hidden;
 }

#animate-container.preanimate,
#container {
  -webkit-transform: rotateY(0deg);
}
#animate-container {
  -webkit-transform: rotateY(-180deg);
}

.animate {
  -webkit-transition: -webkit-transform 0.5s;
}

#container.preanimate {
  -webkit-transform: rotateY(180deg);
}

#animate-container div,
#container div {
  -webkit-backface-visibility: hidden;
  -webkit-transform:translate3d(0,0,0);
}

So I'm experiencing the following issues: 因此,我遇到以下问题:

  1. Some of the div content blinks a bunch or isn't visible until it ends 某些div内容闪烁一堆或直到结束才可见
  2. After rotating views for a while the phasing in div stops working 旋转视图一段时间后,div的逐步停止工作

It's an usual problem when moving coplanar things in 3D. 在3D模式下移动共面物体时,这通常是一个问题。

Set that: 设置为:

.row {
    -webkit-transform: translateZ(1px);
}

It makes the row stand above the parent, and solves the issue 它使行位于父级之上,并解决了问题

Cool page, by the way ! 顺便说一下,很酷的页面!

You can add keyframes to make the animation. 您可以添加关键帧以制作动画。 You can check it out here. 您可以在这里查看。

https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Using_CSS_animations https://developer.mozilla.org/zh-CN/docs/Web/Guide/CSS/Using_CSS_animations

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

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