make accordion arrows change direction when open or close
This commit is contained in:
parent
895b1d37d4
commit
d999315ad1
2 changed files with 21 additions and 5 deletions
11
app/static/js/about.js
Normal file
11
app/static/js/about.js
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
document.querySelectorAll('.accordion-checkbox').forEach(cbox => {
|
||||
cbox.addEventListener('change', function() {
|
||||
const label = this.previousElementSibling
|
||||
const caret = label.querySelector('.text')
|
||||
if (cbox.checked) {
|
||||
caret.innerHTML = '▼'
|
||||
} else {
|
||||
caret.innerHTML = '▶'
|
||||
}
|
||||
})
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue