<body>
<header></header>
<div id="wrap">
<form >
<teatarea></teatarea>
<input />
....
<div class="tool" style="height:0"></div>
</form>
//其他内容
</div>
</body>
需要实现的效果是:当点击这个form表单这一块地方时,我就将 style="height:0" 的高度设置为40,然后 如果是点击 这个form表单以外的任何一个地方,都将style="height:0"这个height的值设置为 0 ,
求教一下各位朋友,,,这个用jq 或js 该怎么写,,
------解决思路----------------------
$('form:eq(0)').bind('click',function(ev){
$('div .tool').css('height', '40');
ev.stopPropagation(); //阻止事件冒泡
});
$(document).bind('click',function(){
$('div .tool').css('height', '0');
});