Home  >  Article  >  Backend Development  >  求教怎么实现页面点击效果

求教怎么实现页面点击效果

WBOY
WBOYOriginal
2016-06-13 12:26:081214browse

求教如何实现页面点击效果


     



    
        

         
         
         ....
        

         
      

    
     //其他内容




需要实现的效果是:当点击这个form表单这一块地方时,我就将 style="height:0" 的高度设置为40,然后 如果是点击 这个form表单以外的任何一个地方,都将style="height:0"这个height的值设置为 0 ,

求教一下各位朋友,,,这个用jq 或js 该怎么写,,




------解决思路----------------------
	$('form:eq(0)').bind('click',function(ev){<br />		$('div .tool').css('height', '40');<br />		ev.stopPropagation(); //阻止事件冒泡<br />	});<br />	$(document).bind('click',function(){<br />		$('div .tool').css('height', '0');<br />	});
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn