[c] debug change to red on hover and not always

This commit is contained in:
Sangelo 2024-06-11 23:37:17 +02:00
parent 77ff08f737
commit 77d866f3c9

View file

@ -17,11 +17,15 @@
function checkOverflow() {
const modCards = document.querySelectorAll('.mod-card');
modCards.forEach((modCard) => {
if (modCard.scrollHeight > modCard.offsetHeight) {
modCard.style.backgroundColor = 'red';
} else {
modCard.addEventListener('mouseover', () => {
if (modCard.scrollHeight > modCard.offsetHeight) {
modCard.style.backgroundColor = 'red';
}
});
modCard.addEventListener('mouseout', () => {
modCard.style.backgroundColor = '';
}
});
});
}