【发布时间】:2015-11-16 15:38:48
【问题描述】:
当我点击场景时,盒子会掉下来。当我再次单击时,框会立起来。动画很流畅,但是当我在不同的位置多次点击时,有时动画会跳帧。
我在 Google Chrome 的 OS X 上遇到了这个错误。在 Opera 中测试 — 一切正常,没有错误。
http://jsfiddle.net/nw78myhn/1/
有人知道如何解决这个问题吗?
<div class="scene">
<div class="box"></div>
</div>
.scene {
width: 500px;
height: 500px;
position: absolute;
background: #efefef;
}
.box {
position: absolute;
left: 250px;
top: 100px;
width: 70px;
height: 140px;
background: #000;
transform: rotate(0deg);
transform-origin: bottom left;
transition: transform 600ms linear;
}
.box-transform {
transform: rotate(-96deg);
}
$('.scene').on('click', function() {
$('.box').toggleClass('box-transform');
});
更新:
我注意到如果将transform-origin 设置为.box-transform 而不是.box,则不会跳帧:
http://jsfiddle.net/nw78myhn/2/
但在这种情况下,原点在视觉上并不位于bottom left。而且我真的不明白为什么。
更新 2 [2016 年 2 月 16 日]: 此错误已在较新版本的 Google Chrome 中修复。无法在 Chrome 48.0.2564.109 中重现
【问题讨论】:
-
您好,我使用的是 MAC OS X 和 google chrome,无法重现您的问题。
-
嗨,尝试点击场景的不同点
-
@imkost 嗨,它甚至可以在具有 Windows 8 的 chrome 上复制
标签: css google-chrome css-transitions css-transforms