jquery Bootstrap Collapse无法处理灰尘

2guxujil  于 2022-12-03  发布在  jQuery
关注(0)|答案(1)|浏览(115)

我是一个很新的表达js和引导程序。我正在使用灰尘视图引擎。一切都工作正常,除了折叠功能。它是不工作。我的布局。灰尘文件包括jquery和引导程序-

<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
    <link rel = "stylesheet" href = "/stylesheets/bootstrap.css" />
    <link rel = "stylesheet" href = "/stylesheets/style.css" />
</head>
<body>
    <div class = "container" >
        <div class = "row">
            <div class = "col-md-offset-2 col-md-7">
                {+body /}
            </div>
        </div>
    </div>        
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
    <script src = "/javascripts/bootstrap.js"/>
</body>
</html>

我试图在我的index.dust中获得一个崩溃效果,用于点击按钮,但不幸的是它不起作用

{> "layout"/}
{<body}
   {#models}
    <div class = "well">
        <h4>{Name} <button class="btn btn-default pull-right" data-toggle="collapse" 
        data-target="#models_{Name}" aria-expanded="false" aria-controls="models_{Name}">View</button></h4>
        <div class="collapse" id="models_{Name}">
            TREST
        </div>

    </div>
   {/models}
   {/body}

有人能帮帮我吗?

rekjcdws

rekjcdws1#

我是新来的,我想你可能错过了href属性?
你试过吗?:

{> "layout"/}
{<body}
   {#models}
    <div class = "well">
        <h4>{Name} <button class="btn btn-default pull-right" data-toggle="collapse" 
        data-target="#models_{Name}" href="#models_{Name}" aria-expanded="false" aria-controls="models_{Name}">View</button></h4>
        <div class="collapse" id="models_{Name}">
            TREST
        </div>

    </div>
   {/models}
   {/body}

相关问题