$(document) 和 $(e.target)实现div的显示和隐藏

$(document).click(function(e){

    if($(e.target).hasClass("zm_view")){
        $(".question").hide();
        $(e.target).parent().parent().next().show();
}

});

 

$(document) 是当前文档,就是你看到的整个网页

$(window) 如果没有框架则就是你浏览的当前浏览器的窗口

posted @ 2015-01-08 14:43  cornucopia  阅读(503)  评论(0编辑  收藏  举报