Skip to content

Commit

Permalink
Fixed js
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan360 committed Nov 14, 2023
1 parent ff67672 commit 5764206
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 20 deletions.
Binary file added favicon.ico
Binary file not shown.
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="style.css">
<link rel="icon" href="favicon.ico" type="image/x-icon">
</head>
<body>
<header>
Expand Down
25 changes: 5 additions & 20 deletions script.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@

// Модальное окно
const modal = document.getElementById("modal"); // Кнопка открытия
const btns = document.getElementsByClassName("btn-reserve"); // Кнопки модального окна
const span = document.getElementsByClassName("close"); // Кнопки закрытия
// Изменение стилей (отображения) при клике
// btn.onclick = function() {
// modal.style.display = "block";
// }
// span.onclick = function() {
// modal.style.display = "none";
// }

// Если кликнуть на модальном окне, оно отключится
window.onclick = function(event) {
if (event.target == modal) {
Expand All @@ -29,20 +22,12 @@ function closeNav() {
// Перебор кнопок
for(let elem of btns){
elem.onclick = function() {
if (modal.style.display === "block") {
modal.style.display = "none";
} else {
modal.style.display = "block";
}
};
modal.style.display = "block"
}
}
// Кнопки закрытия
for(let close of span){
close.onclick = function() {
if (modal.style.display === "block") {
modal.style.display = "none";
} else {
modal.style.display = "block";
}
};
modal.style.display = "none"
}
}

0 comments on commit 5764206

Please sign in to comment.