如何解决meta name =“ theme-color”的动画
我想使用由a=[1,2,3]
b=[1,3]
new_a=list(el for el1 in zip(* [a]*len(b)) for el in el1)
new_b=b*len(a)
中的几种颜色组成的动画,例如:#87CEFA,#1E90FF,#4169E1 ...
是否可以在Android上的Chrome中为>>> new_a
[1,1,3,3]
>>> new_b
[1,3]
设置动画?
解决方法
最后,我找到了使用以下JavaScript代码解决此问题的方法。使用此代码,浏览器URL栏上的3种主题颜色会动态更改。
var themeColorTest = new function() {
function e() {
"#87CEFA" === $themeColor.content ? $themeColor.content = "#1E90FF" : "#1E90FF" === $themeColor.content ? $themeColor.content = "#4169E1" : $themeColor.content = "#87CEFA",setTimeout(e,500)
}
this.init = function() {
$themeColor = document.querySelector("meta[name='theme-color']"),e()
}
};
themeColorTest.init();
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Animation of meta name theme-color</title>
<meta name="theme-color" content="#87CEFA" />
</head>
<body>
<p>More info on the <code>theme-color</code> meta tag is at this <a href="https://developers.google.com/web/updates/2014/11/Support-for-theme-color-in-Chrome-39-for-Android?hl=en">Google Developers Blog Post</a>.</p>
</body>
</html>
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。