$.each(disease_intr,function(i)
{
var num = disease_intr[i].indexOf("介绍");
var diseaseTitle = disease_intr[i].substring(0,num+2);
$("#detail").append("<div class='title'>"+diseaseTitle+"</div>");
var diseaseIntr = disease_intr[i].replace(diseaseTitle, " ");
$("#detail").append("<div class='intrCss'>"+diseaseIntr.trim()+"</div>");
//切换元素的可见状态
$(".title").toggle(function(){
$(this).next().show();
}, function(){
$(this).next().hide();
});
});
title
content
点击title隐藏content,第二次点击显示content。。。