[英]How do I link a toggle event to a single bootstrap collapse heading?
basically want to toggle the visibility of a separate element by linking up with the toggling of a bootstrap-collapsed heading. 基本上是想通过与自举折叠标题的切换链接来切换单独元素的可见性。 in the case below, the clicking of "#producer" will expand/collapse "#collapseOne".
在以下情况下,单击“ #producer”将展开/折叠“ #collapseOne”。 i want that same function to make ".cv" appear and disappear too.
我想要使“ .cv”出现和消失的相同功能。 i don't want other headings to affected, though, so it should be specific to just clicking "#producer".
不过,我不希望其他标题受到影响,因此应该只单击“ #producer”即可。
markup: 标记:
<div class="panel-heading">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion" href="#collapseOne" id="producer">Producer Reel <em>For Hire!</em>
</a>
<a class="cv" href="#">
<i class="icon-file-text-alt"></i>my CV
</a>
</div>
<div id="collapseOne" class="panel-collapse collapse">
<div class="panel-body">...</div>
any help would be appreciated! 任何帮助,将不胜感激!
$('.accordion-toggle').click(function(){
$(this).next('.cv').collapse('toggle');
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.