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

原创
2015/01/03 15:40
阅读数 3.8K

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



展开阅读全文
加载中
点击引领话题📣 发布并加入讨论🔥
0 评论
14 收藏
0
分享
返回顶部
顶部