【发布时间】:2021-05-03 17:18:55
【问题描述】:
我已经实现了一个基本的手风琴,我需要在手风琴上添加 + 和 -。
如果手风琴是打开的,那么'-'应该是'+'
这是尝试过的:
JS:
$('.info').find('.accordion-toggle').click(function () {
//Expand or collapse this panel
$(this).next().slideToggle('fast');
//Hide the other panels
$(".accordion-content").not($(this).next()).slideUp('fast');
});
【问题讨论】:
-
我会用 css 和一个“活动”类来做。也可以使用 css 进行上/下滑动。
-
@KevinB : 你能帮我看看你的实现演示吗
标签: javascript html jquery css