Dantes (обсуждение | вклад) Нет описания правки |
Dantes (обсуждение | вклад) Нет описания правки |
||
| Строка 1: | Строка 1: | ||
document.addEventListener('DOMContentLoaded', function() { | document.addEventListener('DOMContentLoaded', function() { | ||
const | const tableRows = document.querySelectorAll('.standard-link tr'); | ||
tableRows.forEach(row => { | |||
const linkCell = row.querySelector('td:nth-child(2) a'); | |||
const imageCell = row.querySelector('td:nth-child(1)'); | |||
if (linkCell && imageCell) { | |||
linkCell.addEventListener('mouseover', function() { | |||
imageCell.classList.add('highlight'); | |||
linkCell.classList.add('highlight'); | |||
}); | |||
linkCell.addEventListener('mouseout', function() { | |||
imageCell.classList.remove('highlight'); | |||
linkCell.classList.remove('highlight'); | |||
}); | |||
imageCell.addEventListener('mouseover', function() { | |||
imageCell.classList.add('highlight'); | |||
linkCell.classList.add('highlight'); | |||
}); | |||
imageCell.addEventListener('mouseout', function() { | |||
imageCell.classList.remove('highlight'); | |||
linkCell.classList.remove('highlight'); | |||
}); | |||
} | |||
}); | }); | ||
}); | }); | ||
Версия от 22:48, 29 августа 2024
document.addEventListener('DOMContentLoaded', function() {
const tableRows = document.querySelectorAll('.standard-link tr');
tableRows.forEach(row => {
const linkCell = row.querySelector('td:nth-child(2) a');
const imageCell = row.querySelector('td:nth-child(1)');
if (linkCell && imageCell) {
linkCell.addEventListener('mouseover', function() {
imageCell.classList.add('highlight');
linkCell.classList.add('highlight');
});
linkCell.addEventListener('mouseout', function() {
imageCell.classList.remove('highlight');
linkCell.classList.remove('highlight');
});
imageCell.addEventListener('mouseover', function() {
imageCell.classList.add('highlight');
linkCell.classList.add('highlight');
});
imageCell.addEventListener('mouseout', function() {
imageCell.classList.remove('highlight');
linkCell.classList.remove('highlight');
});
}
});
});