Skip to content

Instantly share code, notes, and snippets.

@kobitoDevelopment
Last active May 29, 2022 02:50
Show Gist options
  • Select an option

  • Save kobitoDevelopment/46b1ede19eaa0a4c2c2a288e979e0bd8 to your computer and use it in GitHub Desktop.

Select an option

Save kobitoDevelopment/46b1ede19eaa0a4c2c2a288e979e0bd8 to your computer and use it in GitHub Desktop.
<p class="hoge">ボタン</p>
<p class="fuga">ボタン</p>
const hoge = document.querySelector(".hoge");
const fuga = document.querySelector(".fuga");
hoge.addEventListener("click", function () {
fuga.classList.add("is-show");
});
.fuga {
display: none;
&.is-show {
display: block;
animation: fugaAnm 1s 0s forwards;
}
}
@keyframes fugaAnm {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment