Syntax highlight on-demand example, fix rollover

This commit is contained in:
Francis Lavoie 2023-11-22 05:51:58 -05:00
parent 7cba863d53
commit 4610d84904
No known key found for this signature in database
GPG key ID: 0F66EE1687682239
4 changed files with 40 additions and 27 deletions

View file

@ -20,14 +20,5 @@ const resp = fetch("/resources/testimonials.json").then(async resp => {
}
$_(`.testimonial-col:nth-child(${i%3 + 1})`).append(tpl);
}
on('mouseover', '.rollover', e => {
const target = e.target.closest('.rollover') || e.target;
$$_(`.${target.dataset.rollover}`).forEach(elem => elem.classList.add('show'));
});
on('mouseout', '.rollover', e => {
const target = e.target.closest('.rollover') || e.target;
$$_(`.${target.dataset.rollover}`).forEach(elem => elem.classList.remove('show'));
});
});
});