Modal #171
Unanswered
Serhatpars
asked this question in
Q&A
Modal
#171
Replies: 1 comment
-
Hello! As I see, the JavaScript code for running the modal example is missing in the documentation 😕, sorry... Please try this HTML code: <div id="modal" class="scrim is-hidden">
<div class="modal">
<div class="is-flex has-items-center">
<div class="title is-4 has-mb-0">Modal</div>
<div class="close has-ml-auto"></div>
</div>
<div class="has-pt-6">
Content of the modal
</div>
</div>
</div> (Note that I have added an Now, if you have for example a button with the ID document.getElementById("#display-modal-btn").addEventListener("click", () => {
document.getElementById("modal").classList.remove("is-hidden");
}); And to hide the modal when the document.querySelector("#modal .close").addEventListener("click", () => {
document.getElementById("modal").classList.add("is-hidden");
}); Please tell me if this works for you. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've never been able to make a Modal. can you help please? thank you!
https://siimple.xyz/docs/elements/modal
Beta Was this translation helpful? Give feedback.
All reactions