Home  >  Article  >  Web Front-end  >  Three small examples of closing pop-up layers in jquery_jquery

Three small examples of closing pop-up layers in jquery_jquery

WBOY
WBOYOriginal
2016-05-16 17:17:351001browse

In developing applications, we make a pop-up layer. Sometimes we make a close button, so that clicking close can close the pop-up layer. However, sometimes we hope that the pop-up layer will be automatically closed as long as we don’t click inside the pop-up layer. Below I summarized three examples.
Example 1

Copy code The code is as follows:

< ;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
< html xmlns="http://www.w3.org/1999/xhtml">

Click on the blank space to close the pop-up window
< meta http-equiv="content-type" content="text/html;charset=gb2312">







Example 2, click somewhere other than itself to close the pop-up layer

Copy the code The code is as follows:






;
show-area




" -//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


jQuery click on the blank space to close the popup layer




Open me, click Blank is closed, thank you

Open popup layer




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