Jak*_*123 1 html javascript css css3 css-transitions
我在这里使用CSS:
@keyframes themesappear{
0% {
opacity: 0;
} 100% {
opacity: 1;
}
}
@-webkit-keyframes themesappear{
0% {
opacity: 0;
} 100% {
opacity: 1;
}
}
Run Code Online (Sandbox Code Playgroud)
和Javascript在这里:
var theme = function() {
document.getElementById('themes').style.animation = "themesMappear 2s forwards;";
document.getElementById('themes').style.WebkitAnimation = "themesappear 2s forwards;";
};
Run Code Online (Sandbox Code Playgroud)
试图让id为"主题"的div淡入并出现......
问题是onclick不起作用,不透明度也没有变化,我该如何解决这个问题呢?你可以在这里看到这个网站
我如何使用onlclick: <h1 id = "WM" onclick = "theme()">Change Theme</h1>
一些事情
themesMappear而不是themesappear)"themesMappear 2s forwards",而不是 "themesMappear 2s forwards;"| 归档时间: |
|
| 查看次数: |
2937 次 |
| 最近记录: |