jq 点击空白处隐藏

$(document).click(function(event){
        var _con = $('.form-search'); //设置空白区域
        if(!_con.is(event.target) && _con.has(event.target).length === 0){
            $('.froms').css({'display': 'none'});
            $('.tos').css({'display': 'none'});
        }
    });

 

posted @ 2020-12-17 21:27  小蘑菇123  阅读(119)  评论(0编辑  收藏  举报