Popover中的Bootstrap手风琴

时间:2015-10-27 03:09:38

标签: html css twitter-bootstrap accordion popover

我已经尝试过并试图弄清楚如何让手风琴在弹出窗口内工作。我似乎无法弄明白。样品手风琴不在弹壳内工作就好了。我在下面添加了一些示例代码。任何帮助表示赞赏。

<div class="hidden-md hidden-lg" style="float: right; padding: 15px 0px 15px 15px;">
<a data-placement="bottom" data-toggle="popover" data-container="body" type="button" data-html="true" href="#"><i class="fa fa-chevron-right"></i> FILTERED BY</a>


    <div id="popover-content" class="hide">

        <div class="panel-group" id="accordion">
            <!-- accordion 1 -->
            <div class="panel panel-primary">

                <div class="panel-heading">
                    <!-- panel-heading -->
                    <h4 class="panel-title">
                        <!-- title 1 -->
                        <a data-toggle="collapse" data-parent="#accordion" href="#accordionOne">
                            Collapsible Accordion 1
                        </a>
                    </h4>
                </div>
                <!-- panel body -->
                <div id="accordionOne" class="panel-collapse collapse in">
                    <div class="panel-body">
                        Lorem ipsum dolor sit amet, consectetur adipisicing elit,
                        sed do eiusmod tempor incididunt ut labore et dolore magna
                        aliqua. Ut enim ad minim veniam, quis nostrud exercitation
                        ullamco laboris nisi ut aliquip ex ea commodo consequat
                    </div>
                </div>
            </div>

            <div class="panel panel-success">
                <!-- accordion 2 -->

                <div class="panel-heading">
                    <h4 class="panel-title">
                        <!-- title 2 -->
                        <a data-toggle="collapse" data-parent="#accordion" href="#accordionTwo">
                            Collapsible Accordion 2
                        </a>
                    </h4>
                </div>
                <!-- panel body -->
                <div id="accordionTwo" class="panel-collapse collapse">
                    <div class="panel-body">
                        Change does not roll in on the wheels of inevitability,
                        but comes through continuous struggle.
                        And so we must straighten our backs and work for
                        our freedom. A man can't ride you unless your back is bent.
                    </div>
                </div>

            </div>

            <div class="panel panel-warning">
                <!-- accordion 3 -->

                <div class="panel-heading">
                    <h4 class="panel-title">
                        <!-- title 3 -->
                        <a data-toggle="collapse" data-parent="#accordion" href="#accordionThree">
                            Collapsible Accordion 3
                        </a>
                    </h4>
                </div>

                <div id="accordionThree" class="panel-collapse collapse">
                    <!-- panel body -->
                    <div class="panel-body">
                        You must take personal responsibility.
                        You cannot change the circumstances,
                        the seasons, or the wind, but you can change yourself.
                        That is something you have charge of.
                    </div>

                </div>

            </div>

        </div>

    <script type="text/javascript">
        $("[data-toggle=popover]").popover({
            html: true,
            content: function() {
                var clone = $('#popover-content').clone(true).html();
                return clone;
            }
        });
    </script>

</div>

<div style="border-top: solid 1px #aaaaaa; clear: both;" class="hidden-md hidden-lg"><br/><br/>
</div>
</div>

1 个答案:

答案 0 :(得分:3)

这是demo给你的

你可能不得不改变一些#include "my_arm.h" ,但你会明白这一点。

以下是css代码

html

还有一点<div class="container-fluid"> <div class="row-fluid" style="margin-top:200px"> <div class="span12" style="float: middle; margin: 15px 0px 15px 15px;"> <a href="#" id="popoverExampleTwo">Popover Example 2</a> <div id="popoverExampleTwoHiddenContent" style="display: none"> <div class="panel-group" id="accordion"> <!-- accordion 1 --> <div class="panel panel-primary"> <div class="panel-heading"> <!-- panel-heading --> <h4 class="panel-title"> <!-- title 1 --> <a data-toggle="collapse" data-parent="#accordion" href="#accordionOne"> Collapsible Accordion 1 </a> </h4> </div> <!-- panel body --> <div id="accordionOne" class="panel-collapse collapse in"> <div class="panel-body">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat</div> </div> </div> <div class="panel panel-success"> <!-- accordion 2 --> <div class="panel-heading"> <h4 class="panel-title"> <!-- title 2 --> <a data-toggle="collapse" data-parent="#accordion" href="#accordionTwo"> Collapsible Accordion 2 </a> </h4> </div> <!-- panel body --> <div id="accordionTwo" class="panel-collapse collapse"> <div class="panel-body">Change does not roll in on the wheels of inevitability, but comes through continuous struggle. And so we must straighten our backs and work for our freedom. A man can't ride you unless your back is bent.</div> </div> </div> <div class="panel panel-warning"> <!-- accordion 3 --> <div class="panel-heading"> <h4 class="panel-title"> <!-- title 3 --> <a data-toggle="collapse" data-parent="#accordion" href="#accordionThree"> Collapsible Accordion 3 </a> </h4> </div> <div id="accordionThree" class="panel-collapse collapse"> <!-- panel body --> <div class="panel-body">You must take personal responsibility. You cannot change the circumstances, the seasons, or the wind, but you can change yourself. That is something you have charge of.</div> </div> </div> </div> <script type="text/javascript"> $("[data-toggle=popover]").popover({ html: true, content: function() { var clone = $('#popover-content').clone(true).html(); return clone; } }); </script> </div> </div> <div id="popoverExampleTwoHiddenTitle" style="display: none"> Popover Example <b>2</b> - Title </div> </div> </div> </div> 来设置popover正文中的标题和内容

script

我所做的只是通过javascript处理popover内容,我不太擅长解释,但你会理解看演示。

希望回答问题