我有下拉菜单,看起来像:http://jsbin.com/akidiw/2/edit
点击"第一",然后点击"第二",再点击"第三",你就会看到问题了。我知道这都是因为那部分
$("span.toggle").click(function() {
$(this).addClass('expanded');
$(this).next().toggle(1000);
$(this).parent().parent().find('.expanded').not(this).each(function(){
$(this).next().toggle(1000);
});
});
我想当你展开一个对象,你点击第二个,第一个正在关闭。请帮助
永远不要从关闭的项中删除"expanded"类。
在"click"事件上,遍历已"展开"的项并删除该类。