jQuery Close DIV By Clicking Anywhere On Page

后端 未结 5 794
夕颜
夕颜 2021-01-13 11:07

I would like to open email-signup when I click on email-signup-link. Then I would like to close it by clicking anywhere on the page except for the

5条回答
  •  既然无缘
    2021-01-13 11:26

    $(":not(#email-signup)").click(function() {
         $("#email-signup").hide();
    });
    

    Although you'd be better off having some kind of an overlay behind the popup and binding the above click event to that only.

提交回复
热议问题