Home > php教程 > php手册 > body text

Click on other hidden divs

WBOY
Release: 2016-07-06 13:29:23
Original
2143 people have browsed it

Click elsewhere to hide a specific div
<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script><br>     <div id="b" style="display:none;width:100px;height:100px;background:#ccc;">收尾</div><br>     <a href="#" id="show">点击显示</a><br>     <script><br>         $b = $("#b");<br>         $("#show").on({<br>             "click": function(){<br>                 $b.toggle();<br>                 return false;<br>             }<br>         });<br>         $(document).on({<br>             "click": function(e){<br>                 var src = e.target;<br>  <br>                 if(src.id && src.id ==="b"){<br>                     return false;<br>                 }else{<br>                     $b.hide();<br>                 }<br>             }<br>         });<br>     </script>

Yunqi Conference Beijing Station: It’s rare for Alibaba technical experts to make an appearance. More than 100 people came this time? !

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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template