8,545
edits
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
document.addEventListener('DOMContentLoaded', function () { | |||
var tooltipContainers = document.querySelectorAll('.tooltip23-container'); | |||
tooltipContainers.forEach(function (container) { | |||
container.addEventListener('click', function () { | |||
// Скрыть все другие всплывающие окна | |||
tooltipContainers.forEach(function (otherContainer) { | |||
if (otherContainer !== container) { | |||
otherContainer.classList.remove('active'); | |||
} | |||
}); | |||
// Показать/скрыть текущее всплывающее окно | |||
container.classList.toggle('active'); | |||
}); | |||
}); | |||
// Скрыть всплывающее окно при клике вне элемента | |||
document.addEventListener('click', function (event) { | |||
tooltipContainers.forEach(function (container) { | |||
if (!container.contains(event.target)) { | |||
container.classList.remove('active'); | |||
} | |||
}); | |||
}); | |||
}); | |||
document.addEventListener('DOMContentLoaded', function() { | document.addEventListener('DOMContentLoaded', function() { | ||
var popup = document.getElementById('concert-list-popup'); | var popup = document.getElementById('concert-list-popup'); |