Home > Web Front-end > JS Tutorial > JQuery realizes clicking outside the div to hide the div window_jquery

JQuery realizes clicking outside the div to hide the div window_jquery

WBOY
Release: 2016-05-16 17:22:40
Original
1266 people have browsed it

jquery realizes that the div window disappears when the mouse clicks outside the div

Copy the code The code is as follows:





Web page special effects display center







Click on a blank space to specify the div to hide and disappear



Copy code The code is as follows:

The div with class="bigPic" is displayed Or a hidden div, in addition. case > ul > li is the parent element of class="bigPic"

$("body").bind("click",function(evt){
if($(evt.target).parents(".case > ul > li").length==0)
{
$('.bigPic').hide();
}

});
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