开发者

jQuery intercept slideToggle()

开发者_开发问答

I'm doing a very simple slideToggle() here:

            $("#loginBtn").click(function(){
                $("#login").slideToggle();
                return false;
            });

What i'm asking is, how do i intercept the slideToggle, so once the user clicks #loginBtn and #login slides down, they can either click #loginBtn again to slide it up OR they can click another element to slide #login up? But only the #loginBtn slides down the #login?

Thanks


Bind some slideUp goodness to your 'other elements'?

$(".otherButtons").click(function() {
    $("#login").slideUp();            
    return false;
});
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜