【发布时间】:2015-06-20 04:05:24
【问题描述】:
我有一个展开/折叠框,单击时标题会从“单击以显示更多信息...”变为“单击以显示较少信息...”
我的问题是,当框折叠时,单击时它不会变回“单击以显示更多信息...”。有没有办法编辑我必须实现的代码?
这是我的小提琴和代码:http://jsfiddle.net/HFcvH/25/
jQuery
jQuery(document).ready(function() {
jQuery(".content").hide();
//toggle the componenet with class msg_body
jQuery(".heading").click(function() {
jQuery(this).next(".content").slideToggle(500);
jQuery(this).text("Click here for less information...");
});
});
HTML
<p class="heading">Click here for more info... </p>
<div class="content">
<span style="font-size: 14px; color: rgb(6, 78, 137);">
<b>Documents Required</b>
</span>
</div>
【问题讨论】:
-
欢迎来到 StackOverlow!请确保您了解rules。如果您发现以下任何一个答案足够好,请点赞并接受。
-
@JoelAlmeida,将代码块放在a bulleted list 中没有意义。
-
@gunr2171 原始帖子有一个项目符号列表。那是我的错。
-
@JoelAlmeida,确实如此,我没有注意到。您的编辑必须同时赶上另一个编辑。那就不用担心了。
标签: jquery html collapse expand