实施twitter bootstrap手风琴的麻烦

时间:2013-10-09 20:07:15

标签: javascript jquery html twitter-bootstrap knockout.js

我无法实现twitter bootstrap的手风琴功能,并想知道是否有人可以看看并指出它为什么不起作用:

<div class="accordion">
            <div class="accordion-group" style="display:none" id="View" data-bind="foreach:Types">
                <div class="accordion-heading">
                    <div class="text_x-large header"><span data-bind="text:Name()"></span> 
                        <span class="icon-plus-sign-alt accordion-toggle"></span>
                    </div>
                </div>
                <div class="accordion-body collapse in" data-bind="template: { name: 'list', foreach: $data.Users }"></div>
            </div>
        </div>

最后一个div调用以下内容放置在具有类崩溃的div中:

<script type="text/html" id="list">
    <div class="accordion-inner">
        <h3 id="letter" data-bind="text: Letter"></h3>
        <div class="smoke_hover" >
            <div class="list_item">
                <span class="h2"><small data-bind="text: Name"></small></span>
            </div>
        </div>
    </div>
</script>

1 个答案:

答案 0 :(得分:1)

我重新安排了您的设置,使其更像是来自引导程序docscollapse示例,它就像魅力一样

这是小提琴:http://jsfiddle.net/Jgdmq/