jquery 點擊彈窗之外的地方,關(guān)閉?彈窗

字號:


    jquery 點擊彈窗之外的地方,關(guān)閉彈窗
    方法一:
    $(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");
    })