开发者

Why doesn't this event unbind using jQuery?

开发者 https://www.devze.com 2023-01-19 15:15 出处:网络
I have seen similar questions but I can\'t figure out what I am doing wrong here.The dropdown is shown after an ajax call completes successfully then I want to hide it when a user clicks anywhere.I wo

I have seen similar questions but I can't figure out what I am doing wrong here. The dropdown is shown after an ajax call completes successfully then I want to hide it when a user clicks anywhere. I would like to rem开发者_如何转开发ove the event though because there is no need to hide it if it is already hidden.

        dropDown.slideDown('fast');
        $(document).bind('click.test', function() {
            alert('click');
            dropDown.slideUp('fast');
            $(document).unbind('click.test');
        });

Any thoughts?


You can call the one method instead.

0

精彩评论

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