我如何在默认情况下关闭这个collasible面板?

时间:2016-04-29 09:26:40

标签: javascript html twitter-bootstrap twitter-bootstrap-3 javascript-events

我试图按照这里的例子

http://www.prepbootstrap.com/bootstrap-template/collapsepanels

默认情况下,如何显示面板已关闭?

2 个答案:

答案 0 :(得分:0)

你必须像这样创建你的面板:

<div class="panel panel-default ">
                <div class="panel-heading ">
                    <h3 class="panel-title">Panel 1</h3>
                    <span class="pull-right clickable panel-collapsed"><i class="glyphicon glyphicon-chevron-down"></i></span>
                </div>
                <div class="panel-body collapse" style="display: none;">
                    Founded in 1892 and headquartered in Fairfield, CT, LexisNexis Corporate Affiliations 
                    is a technology and financial services company. 
                    The company offers products and services ranging from aircraft engines, power generation, 
                    water processing, and household appliances, among others. 
                    It operates in business segments including Energy Infrastructure, Aviation, Healthcare, 
                    Transportation, Home &amp; Business Solutions, and GE Capital. 
                    The company also provides medical imaging, business and consumer financing, 
                    and industrial products. 
                    It has presence in North America, Europe, Asia, South America, and Africa. 
                    According to the company's current 10K government filing it had FYE 12/31/2011 revenue of 
                    $147.3 billion and has 301,000 employees.
                </div>
            </div>

答案 1 :(得分:0)

您使用jQuery执行此操作。使用onclick处理程序slideUp或slideDown面板主体。

这是我的小提琴[可点击面板] [1]

  [1]: https://jsfiddle.net/q8L292sk/