summaryrefslogtreecommitdiff
path: root/actualités.html
diff options
context:
space:
mode:
authorKévin Le Gouguec <kevin.legouguec@gmail.com>2021-02-26 18:09:07 +0100
committerKévin Le Gouguec <kevin.legouguec@gmail.com>2021-02-26 18:09:07 +0100
commit24ff9449a06c94c42f778f9c5d46a7c6e9accd57 (patch)
treebc5cb40d7b71a4bf5b1722d36de2dcdaa5a06eab /actualités.html
parent1c8d3c6ff37892ff4092229039f886dc59619546 (diff)
downloadquatuorbellefeuille.com-24ff9449a06c94c42f778f9c5d46a7c6e9accd57.tar.xz
Keep thumbnail of opened concerts highlighted
Diffstat (limited to 'actualités.html')
-rw-r--r--actualités.html8
1 files changed, 8 insertions, 0 deletions
diff --git a/actualités.html b/actualités.html
index 99d54ae..606bb74 100644
--- a/actualités.html
+++ b/actualités.html
@@ -73,6 +73,8 @@
var anchor = document.location.hash;
if (anchor.match(/#concert-/)) {
document.querySelector(anchor).classList.add('active');
+ document.querySelector(`a[href="${document.location.hash}"]`)
+ .classList.add('active');
}
document.querySelectorAll('a.event').forEach((link) => {
link.addEventListener('click', function(click) {
@@ -84,6 +86,12 @@
prev.classList.remove('active');
var id = link.attributes['href'].value;
document.querySelector(id).classList.add('active');
+
+ prev = document.querySelector('a.event.active');
+ if (prev) {
+ prev.classList.remove('active');
+ }
+ link.classList.add('active');
});
});
</script>