From 898b0ac45b5893675ddf88fef98e5a8390523e79 Mon Sep 17 00:00:00 2001 From: HouTeng Chan <ht-chen21@mails.tsinghua.edu.cn> Date: Mon, 30 Sep 2024 12:11:09 +0000 Subject: [PATCH] Update file human-practices.html --- wiki/pages/human-practices.html | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/wiki/pages/human-practices.html b/wiki/pages/human-practices.html index 41af0bf4..9c458473 100644 --- a/wiki/pages/human-practices.html +++ b/wiki/pages/human-practices.html @@ -757,16 +757,20 @@ </div> -<script> - function toggleContent(element) { - const content = element.querySelector('.expert-content'); - if (content.style.display === 'none' || content.style.display === '') { - content.style.display = 'block'; - } else { - content.style.display = 'none'; - } - } - </script> + <script> + function toggleContent(card) { + var content = card.querySelector('.expert-content'); + var clickForMore = card.querySelector('.click-for-more'); + if (content.style.display === 'none' || content.style.display === '') { + content.style.display = 'block'; + clickForMore.textContent = 'Click to collapse'; + } else { + content.style.display = 'none'; + clickForMore.textContent = 'Click for more'; + } + } + </script> + </body> </html> {% endblock %} \ No newline at end of file -- GitLab