code as folloes:
html code:
<a>click</a>
<div id = "show" style = "display : none"></div>
jquery code:
$(function(){
$('a').click(function(){
var showValue = $('#show').css('display'); //返回到id = show的div的display的值
if(showValue == "" || showValue = "none"){
$('#show').css({display:block});
}else if(showValue == "block"){
$('#show').css({display:none});
}
})
})
OK,我们通过判断display属性的none与block,实现简单的隐藏于现实效果。