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