Dantes (обсуждение | вклад) Нет описания правки |
Dantes (обсуждение | вклад) Нет описания правки |
||
Строка 17: | Строка 17: | ||
card.addEventListener("click", function (event) { | card.addEventListener("click", function (event) { | ||
event.preventDefault(); | event.preventDefault(); | ||
showRaceInfo(card.getAttribute("data-race")); | |||
}); | }); | ||
}); | }); | ||
}); | }); | ||
})(); | })(); |
Текущая версия от 21:18, 15 февраля 2025
(function () { if (window.raceInfoLoaded) return; window.raceInfoLoaded = true; function showRaceInfo(race) { var infoBox = document.getElementById('race-info-box'); var description = document.getElementById(race); if (description) { infoBox.innerHTML = description.innerHTML; infoBox.style.display = 'block'; } } document.addEventListener("DOMContentLoaded", function () { var cards = document.querySelectorAll('.race-card'); cards.forEach(function (card) { card.addEventListener("click", function (event) { event.preventDefault(); showRaceInfo(card.getAttribute("data-race")); }); }); }); })();