Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6160209
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T21:15:40+00:00 2026-05-23T21:15:40+00:00

Ok, so I have a Login form and I’m using Jquery to display it

  • 0

Ok, so I have a Login form and I’m using Jquery to display it in a DIV that is using .slideUp() and .slideDown() to display it.

Can anyone tell me why the form is doing a double-pump (slideup, slidedown, slideup) if you click the .account div to close it (trigger slideup)… ???

If I click outside the form and div it closes fine using this code …

$(".modal_div").live("blur", function(){

        $(".account").removeClass('expand');
        $(this).slideUp();

});

Here is the code I’m using to slideup/slidedown…

$(".account").click(function() {

    if ($(".account").hasClass("expand")) {

        $(".account").removeClass("expand");
        $("#accdropdown").slideUp();
    } else {

        $(".account").addClass("expand");
        $("#accdropdown").slideDown();
        $("#login-username").focus();   
    }       
});

Here is the HTML …

<div class="account">


    <div id="accdropdown" class="modal_div">
    <form action="" method="post">

        <p>
        <label for="login-username">Username</label><br>
        <input type="text" name="user_name" tabindex="1" id="login-username">
        </p>
        <p>
        <label for="login-password">Password</label><br>
        <input type="password" name="password" tabindex="2" id="login-password">
        </p>
        <p class="right">
        <button type="submit" tabindex="3"><span>Log in</span></button>

        </p>

        </form>
        </div>
        <p>Login</p>
    </div>

And the CSS just in case 🙂 …

.account {

    width: 100px;
    height: 78px;
    background: #939393;
    margin-right:100px;
    clear:both;
    float:right;
    cursor:pointer;
}


#accdropdown {
    position:absolute;

    right:0;
    top:22px;
    display:none;
    overflow:hidden;
    z-index:10000;
    width:170px;
    padding:6px 8px 6px;
    border:1px solid #ccc;
    text-align:left;
    background:#e4e4e4 none no-repeat 0 0;
    }

I’ve been ripping my hair out for hours on this, would really appreciate some advice …

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T21:15:41+00:00Added an answer on May 23, 2026 at 9:15 pm

    the issue is with your “blur” when you click on the gray box after opening the new input this is what happens.

    first it blurs (goes up) then it runs the click [and since blur already ran] (it comes down)


    now… how best to fix this?… to start with you probably don’t want to use blur because when a user fills in their username and hits [tab], then the div dissapears…… How do you want it to function?

    If you want it so the .modal_div goes away when a user clicks ‘elsewhere’ I would use an overlay.. here is an example.

    PS: Also you should avoid live if you don’t need it.


    UPDATED
    Option 1: http://jsfiddle.net/mazlix/KztWD/3/

    This puts the login above the overlay… if thats something you don’t want, then use

    Option 2: http://jsfiddle.net/mazlix/KztWD/4/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a login form using jquery ajax and a php code. The issue
I have a login form using a UL and jQuery Validate. It looks fine
Normally pages that have a login form can be downloaded with wget --no-check-certificate --save-cookies
I have a login form that has Username and password as inputs from user
There are some HTML based games (ie bootleggers.us) that have a simple login form
I have a login form that is hidden on every page and shows itself
I have a login form that when submitted; redirects back to the login page.
I have a login form as below, I have tried doing this by onkeydown
I have a login form that contains a username textbox and a password box.
I have simple login form in my website. In given requirements stands, that password

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.