【发布时间】:2015-09-02 21:17:58
【问题描述】:
有没有人知道如何使用twitter bootstrap collapse plugin 显示一些文本(例如,100 个字符),然后单击按钮展开文本以显示其余部分?
Here's a JSFiddle that demonstrates the following issues I'm having:
- 隐藏的文本显示在 new 行上。如果句子不会在视觉上受到干扰,那就更好了。
-
icon-plus-sign指示器的显示未切换(在显示隐藏文本时不会消失,反之亦然)。
完整的 HTML:
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.0/css/bootstrap-combined.min.css" rel="stylesheet">
<script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.0/js/bootstrap.min.js"></script>
<div class="" data-toggle="collapse" data-target="#div1" >
<span><b>Div1:</b> This is a sentence at the end of the first 100 characters that gets truncated </span>
<i class='icon-plus-sign'></i>
</div>
<div id="div1" class="collapse" >such that characters 101 to infinity are not shown inline with the beginning of the sentence (<b>Div1</b>).</div>
<div class="" data-toggle="collapse" data-target="#div2" >
<span><b>Div2:</b>This is a sentence at the end of the first 100 characters that gets truncated </span>
<i class='icon-plus-sign'></i>
</div>
<div id="div2" class="collapse" >such that characters 101 to infinity are not shown inline with the beginning of the sentence (<b>Div2</b>).</div>
【问题讨论】:
标签: javascript jquery twitter-bootstrap