2024-12-17 17:10:37 +01:00
|
|
|
// Open a specific modal
|
|
|
|
|
function openModal(modalId) {
|
|
|
|
|
const modal = document.getElementById(modalId);
|
|
|
|
|
if (modal) {
|
|
|
|
|
modal.style.display = 'flex';
|
|
|
|
|
} else {
|
|
|
|
|
console.error(`Modal with ID "${modalId}" not found.`);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Close a specific modal
|
|
|
|
|
function closeModal(modalId) {
|
|
|
|
|
const modal = document.getElementById(modalId);
|
|
|
|
|
if (modal) {
|
|
|
|
|
modal.style.display = 'none';
|
|
|
|
|
} else {
|
|
|
|
|
console.error(`Modal with ID "${modalId}" not found.`);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-12-17 22:34:05 +01:00
|
|
|
function nextModal(currentModalId, nextModalId) {
|
|
|
|
|
closeModal(currentModalId); // Luk den nuværende modal
|
|
|
|
|
openModal(nextModalId); // Åbn den næste modal
|
|
|
|
|
}
|
|
|
|
|
|
2024-12-17 17:10:37 +01:00
|
|
|
// Ensure all modals are hidden on page load
|
|
|
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
|
|
|
const modals = document.querySelectorAll('.modal'); // Select all modals
|
|
|
|
|
modals.forEach(modal => {
|
|
|
|
|
modal.style.display = 'none';
|
|
|
|
|
});
|
|
|
|
|
});
|