我一次只想展开/折叠一个容器。当我点击第一个容器时,第二个容器应该折叠,当第二个容器展开时,第一个容器应该自动折叠。以下是小提琴。请指导...谢谢展开/收起问题
http://jsfiddle.net/awaises/eK8X5/1138/
jQuery
$(".header").click(function() {
$header = $(this);
$content = $header.next();
$content.slideToggle(500, function() {
$header.text(function() {
return $content.is(":visible") ? "Collapse" : "Expand";
});
});
});
为什么不使用手风琴的文字? http://jqueryui.com/accordion/ – phron