开发者

jQuery intercept slideToggle()

开发者 https://www.devze.com 2023-02-05 06:25 出处:网络
开发者_开发问答I\'m doing a very simple slideToggle() here: $(\"#loginBtn\").click(function(){ $(\"#login\").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

精彩评论

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