我有一个简单的手风琴。它工作但我必须在按钮区域周围添加一个div,现在点击事件根本不起作用。任何帮助都会很棒。
<div class="accordion-ctn clearfix">
<div class="accordion-button-ctn"><div class="accordion-button"><div class="title">Song Title 1</div></div><div class="button_ctn"><ul><li class="play_button"><a href="#">Play<img src="../../images/playBtn.png" alt="Play Button" /></a></li><li class="download_button"><a href="#">Download<img src="../../images/downloadBtn.png" alt="Download Button" /></a></li></ul></div></div>
<div class="accordion-content">
Content here
</div>
</div>
</div>
$('.accordion-button').click(function() {
$('.accordion-button').removeClass('on');
$('.accordion-content').slideUp('normal');
if($(this).next().is(':hidden') == true) {
$(this).addClass('on');
$(this).next().slideDown('normal');
}
});