【发布时间】:2013-09-18 01:50:14
【问题描述】:
所以我在这个网站上工作:http://superfy.me 并且我在路由之间有 CSS3 转换(目前仅适用于 Chrome)。基本上要执行动画,我会执行以下操作:
- 添加
.preanimate类,该类将逐步淘汰的 div 旋转到rotateY(0deg),将 div 中的逐步旋转到rotateY(180deg) - 我添加了
.animate类,该类添加了-webkit-transition: -webkit-transform 0.5s; - 我删除了删除旋转变换的
.preanimate类
这是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);
}
所以我遇到了以下问题:
- 某些 div 内容会闪烁一串或直到结束才可见
- 旋转视图一段时间后,div 中的分阶段停止工作
【问题讨论】:
-
我承认这个问题超出了我的范围,所以我不会尝试回答它,但我可能会建议transit.js。如果您使用的是 jQuery,它添加了一种使用 CSS 过渡的简单方法。只需以与使用 .animate() 相同的方式使用它,在移动设备上也能出色地工作。只是一个建议:)
标签: javascript jquery css css-transitions css-animations