如何隐藏段落,除非您在HTML(或XHTML)中单击该段落

问题描述 投票:0回答:1

我正在使用XHTML在Confluence中使用python编写页面,我希望有一个新页面包含一个段落,当人们进入该页面时该段落被隐藏或被截断,但是如果人们单击它,可以看到它。请检查我所附的两张图片,以便更好地说明我想要的内容

this is what I am looking for

The hidden part reveals once people click on it

javascript html xhtml confluence
1个回答
0
投票

您可以使用jquery实现此目的。假设您使用的图标来说明这三个点。

<style>#hidden_para{display:none;} /* Hide the paragraph*/</style>
<script src="https://code.jquery.com/jquery-3.5.0.js"></script>
<script type="text/javascript">
 $("#icon").click(function(){
   $(this).hide(); //the 3 dotted icon
   //Add an ID attribute to your hidden paragraph.
   $("#hidden_para").show();
 });
</script>
© www.soinside.com 2019 - 2024. All rights reserved.