开发者

jQuery Hide Toggeled Div On Document.click

I currently have the following code:

$(function(){
  $('#btn_signIn').click(function(){
    $('#div_signInBox').toggle("fast");
  });
});

I need to hide the div_signInBox toggled div anytime any other part of the wi开发者_Go百科ndow is clicked...

Thanks!


Is this what you want?

$(function() {
    $('#div_signInBox,html').click(function() {
        if ($(this).is('#div_signInBox')) 
            return false;

        $('#div_signInBox').toggle("fast");
    });
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜