Create modal.js

This commit is contained in:
tokmak0 2022-09-08 15:10:08 +03:00 committed by GitHub
parent 2efb974c31
commit 4e12c2d325
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

19
public/modal.js Normal file
View file

@ -0,0 +1,19 @@
var modal_open = document.querySelectorAll("[data-modal-open]");
modal_open.forEach(onclick_load)
function onclick_load(item, index) {
var block = item.getAttribute("data-modal-open");
console.log("evet");
console.log(item)
document.querySelector(block).classList.toggle("no-active");
document.querySelector("#user-edit").querySelector(".modal-close").onclick = function() {
document.querySelector(block).classList.toggle("no-active");
}
item.onclick = function() {
document.querySelector(block).classList.toggle("no-active");
};
}