');
$(window).scroll(function () {
if ($(this).scrollTop() != 0) {
$('#toHome').fadeIn();
} else {
$('#toHome').fadeOut();
}
});
$('#toHome').click(function(){
$(location).attr('href','https://www.flynovoair.com/');
return false;
});
});
window.addEventListener('load', () => {
const modal = document.getElementById('flashModal');
const closeBtn = document.getElementById('closeModal');
if (modal) {
// Show the modal
modal.showModal();
// 1. Close button logic
closeBtn.addEventListener('click', (e) => {
e.stopPropagation(); // Prevents the click from reaching the backdrop
modal.close();
});
// 2. Click outside logic
modal.addEventListener('click', (event) => {
// This detects if the click was on the backdrop (outside the image wrapper)
const rect = modal.getBoundingClientRect();
const isInDialog = (
rect.top <= event.clientY &&
event.clientY <= rect.top + rect.height &&
rect.left <= event.clientX &&
event.clientX <= rect.left + rect.width
);
// If the click happened on the dialog but NOT inside the content rect
// (Note: With our transparent dialog and centered wrapper,
// the target check is usually enough, but this is the most robust way)
if (event.target === modal) {
modal.close();
}
});
// 3. Auto-close after 20 seconds
setTimeout(() => {
if (modal.open) modal.close();
}, 20000);
}
});
x server