More actions
No edit summary |
No edit summary |
||
Line 7: | Line 7: | ||
hoverTimer = setTimeout(function() { | hoverTimer = setTimeout(function() { | ||
panel.classList.add('hovered'); | panel.classList.add('hovered'); | ||
}, | }, 200); // Delay the flip by 200ms (you can adjust the value) | ||
}); | }); | ||
Revision as of 18:15, 22 December 2024
/* Any JavaScript here will be loaded for all users on every page load. */
document.addEventListener('DOMContentLoaded', function() {
const panel = document.querySelector('.panel');
let hoverTimer;
panel.addEventListener('mouseenter', function() {
hoverTimer = setTimeout(function() {
panel.classList.add('hovered');
}, 200); // Delay the flip by 200ms (you can adjust the value)
});
panel.addEventListener('mouseleave', function() {
clearTimeout(hoverTimer); // Prevent the flip if the mouse leaves before the delay
panel.classList.remove('hovered');
});
});