当我单击以显示切换开关时,它将执行2次,然后再次关闭切换开关,从而隐藏了我的内容。有人可以帮忙吗?
代码如下:
html:
<div class="accordianbx">
<div class="acc_icon">
<div class="whyimgbx"> <span><img src="images/2.png" alt=""></span></div>
<h3>abcd <span>&xyzs </span></h3>
</div>
<div class="hospital acc_descrpbx">
<div class="innrleft_hospitalbx">
<h2>desc </h2>
<p>description</p>
<a href=""> Know More </a>
</div>
</div>
</div>
jquery:
$('.acc_icon').unbind('click').click(function(){
// alert('came into toggle function');
$(this).parents('.accordianbx').find('.acc_descrpbx').slideToggle();
$(this).parents('.accordianbx').siblings().find('.acc_descrpbx').slideUp();
// alert('going out of toggle function');
});