如何获取 Chrome / WebKit 中过渡中的元素的当前颜色?
我有一个镀铬的颜色过渡。我想使用 JavaScript 随时检索颜色。目前,我正在 DOM 中访问 .style.color,但这只能提供目标值。
编辑这个问题不久前就得到了回答,这里有一个 chrome 的例子 http://nu11.co.uk/
I have a color transition in chrome. I would like to retrieve the color at any point using JavaScript. Currently, I'm accessing .style.color in the DOM, but this only gives me the target value.
EDIT this was answered a while ago, an example for chrome can be seem here http://nu11.co.uk/
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
getCompulatedStyle([element],"").getPropertyValue([property])
应该返回过渡颜色(但我还没有检查过。)getComputedStyle([element],"").getPropertyValue([property])
should return the in-transition color (but I haven't checked it.)