码迷,mamicode.com
首页 > Web开发 > 详细

jquery 点击弹窗之外的地方,关闭?弹窗

时间:2015-01-03 17:27:00      阅读:324      评论:0      收藏:0      [点我收藏+]

标签:

jquery 点击弹窗之外的地方,关闭弹窗

方法一:

$(document).click(function(event){
    var _con = $(".select3_box");
    if(!_con.is(event.target) && (_con.has(event.target).length ===0)){
        _con.remove();
        $(mythis).show();
    }
});



方法二:

$(document).click(function(event){
    $(".select3_box").hide();
    $(mythis).show();
});

$(document).delegate(".select3_box","click",function(event){
    event.stopPropagation();
    console.log("ok");
})



jquery 点击弹窗之外的地方,关闭?弹窗

标签:

原文地址:http://my.oschina.net/tongjh/blog/363243

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!