Reputation: 73
I used the CSS here:
@keyframes themesappear{
0% {
opacity: 0;
} 100% {
opacity: 1;
}
}
@-webkit-keyframes themesappear{
0% {
opacity: 0;
} 100% {
opacity: 1;
}
}
and the Javascript here:
var theme = function() {
document.getElementById('themes').style.animation = "themesMappear 2s forwards;";
document.getElementById('themes').style.WebkitAnimation = "themesappear 2s forwards;";
};
in attempt to make the div with the id "themes" fade in and appear...
The problem is the onclick does not work, and neither does the opacity change, how can I fix this? You can see the website here
How I used the onlclick: <h1 id = "WM" onclick = "theme()">Change Theme</h1>
Upvotes: 1
Views: 3402
Reputation: 13974
few things
themesMappear
instead of themesappear
)"themesMappear 2s forwards"
, not "themesMappear 2s forwards;"
Upvotes: 5