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

WBOY
Release: 2016-06-13 12:26:08
Original
1216 people have browsed it

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


     



    
        

         
         
         ....
        

         
      

    
     //其他内容




需要实现的效果是:当点击这个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 />	});
Copy after login
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!