[英]Bootstrap 3.3.7 collapse button issue(doesn't work)
I have the following code: 我有以下代码:
@foreach(var data in Model.test){
<div style="margin: 3% 0 3% 2%;">
<button type="button"
class="btn btn-warning"
style="display:block; width:40%;overflow-wrap:normal;white-space:normal;padding:.5%;"
data-toggle="collapse" data-target="#@data.option">
@data.Name
</button>
<div id="@data.option" class="collapse" style="width:40%;float:right;white-space:normal; overflow:scroll;">
<br />
<div>
<a>
Title: @data.Name<br />
@foreach (var item in data.Documents)
{
<p>Related Document: @item.Name</p>
}
</a>
</div>
</div>
</div>
}
When I tried general example from bootstrap site it works fine.. but when I plug in the values etc I want it fails.. what am I missing? 当我从引导站点尝试一般示例时,它工作正常..但是当我插入值等时,我希望它失败..我缺少什么? This is in a view of an MVC web app.
这是从MVC Web应用程序来看的。
I changed the id to be an incremental counter.. so now it works. 我将ID更改为增量计数器。因此现在可以使用了。 As pointed out I may have had a duplicate somewhere there.
如前所述,我在某处可能有一个副本。
There were spaces and special chars which was causing this issue. 有空格和特殊字符导致此问题。 After removing them all it worked.
删除它们后,一切正常。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.