Výsledkovka čísla (a zobrazování podúloh) onmouseover -> onclick

This commit is contained in:
Jonas Havelka 2021-11-29 21:43:24 +01:00
parent c9fa4607a7
commit 474ef989a9

View file

@ -52,14 +52,16 @@
{# TODELETE #}
<script>
{% for p in problemy %}
diplayed{{ forloop.counter }} = false;
$(".podproblem{{ forloop.counter }}").css("display", "none")
$("#problem{{ forloop.counter }}")[0].addEventListener('mouseover', podproblem{{ forloop.counter }})
$("#problem{{ forloop.counter }}")[0].addEventListener('mouseout', podproblem{{ forloop.counter }}end)
$("#problem{{ forloop.counter }}")[0].addEventListener('click', podproblem{{ forloop.counter }});
function podproblem{{ forloop.counter }}(event) {
$(".podproblem{{ forloop.counter }}").css("display", "")
}
function podproblem{{ forloop.counter }}end(event) {
$(".podproblem{{ forloop.counter }}").css("display", "none")
diplayed{{ forloop.counter }} = !diplayed{{ forloop.counter }};
if (diplayed{{ forloop.counter }}) {
$(".podproblem{{ forloop.counter }}").css("display", "");
} else {
$(".podproblem{{ forloop.counter }}").css("display", "none");
}
}
{% endfor %}
</script>