JS:
function click_a(divDisplay) {
if (document.getElementById(divDisplay).style.display != "block") { //直接引用对象的style属性
document.getElementById(divDisplay).style.display = "block";
}
else {
document.getElementById(divDisplay).style.display = "none";
}
}
JQuery:
$(document).ready(function () {$("#li01").click(function ()
{ if ($('#menu1').css('display') != "block") $("#menu1").show(2000); //$('#menu1').css('display') 获取CSS的属性值
else $("#menu1").hide(2000);
});});