如何获取 Chrome / WebKit 中过渡中的元素的当前颜色?

发布于 2024-11-26 23:15:07 字数 197 浏览 1 评论 0原文

我有一个镀铬的颜色过渡。我想使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

心在旅行 2024-12-03 23:15:07

getCompulatedStyle([element],"").getPropertyValue([property]) 应该返回过渡颜色(但我还没有检查过。)

getComputedStyle([element],"").getPropertyValue([property]) should return the in-transition color (but I haven't checked it.)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文