Skip to content

Commit 434f79c

Browse files
committed
Update event.md
1 parent 5c3d1ac commit 434f79c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

_pages/event.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,4 +323,17 @@ document.addEventListener('DOMContentLoaded', function() {
323323
});
324324
});
325325
});
326+
document.addEventListener('DOMContentLoaded', function() {
327+
var buttons = document.querySelectorAll('.btn[data-toggle="collapse"]');
328+
buttons.forEach(function(button) {
329+
button.addEventListener('click', function() {
330+
var target = document.querySelector(button.getAttribute('data-target'));
331+
if (target.classList.contains('show')) {
332+
target.classList.remove('show');
333+
} else {
334+
target.classList.add('show');
335+
}
336+
});
337+
});
338+
});
326339
</script>

0 commit comments

Comments
 (0)