Home > Web Front-end > JS Tutorial > Implementation code for closing DIV after clicking outside area of ​​DIV_jquery

Implementation code for closing DIV after clicking outside area of ​​DIV_jquery

WBOY
Release: 2016-05-16 17:58:05
Original
1216 people have browsed it

Prevent bubbling:
1. stopPropagation() for non-IE browsers.
2. The cancelBubble attribute is true. For IE browser,
and Jquery already has a browser-compatible method, event.stopImmediatePropagation();

Copy Code The code is as follows:


< div id="myDiv">
This is a div;



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