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 956365
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T00:31:43+00:00 2026-05-16T00:31:43+00:00

Problem I’m trying to do an effect where a pop-up appears when the user

  • 0

Problem

I’m trying to do an effect where a pop-up appears when the user mouses over. The focus is then set on that popup. When the user does a focusout of said pop-up, it disappears.

Example

You can view a working example below, but you’ll need to login as “testuser” in both usernames and password fields. Hover the login box once logged in and a pop-up will appear to tell you you’re already logged in.

http://www.steelfrog.com

I want that pop-up to fade out once the user removed focus from it, since it contains a logout button.

Currently…

What I have so far:

$('.disabled').hover (
    function () { $('#bubble_logged').fadeIn(300); },
    function() { $('#bubble_logged').focus(); }
    );

$('#bubble_logged').focusout ( function () { $('#bubble_logged').fadeOut(300); } );

Apparently, this is not valid, or there’s something I’m not grasping properly. I’m very new to jQuery, so enlightenment would be great!

[EDIT] If you have a better way of doing this, I’m all ears by the way!

  • 1 1 Answer
  • 1 View
  • 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-16T00:31:44+00:00Added an answer on May 16, 2026 at 12:31 am

    You need to use the native javascript focus() method. You can’t use this directly on a jQuery object because that object doesn’t refer to a only a DOM element.

    The selector $('#bubble_logged') will return a jQuery object that contains all items with an ID of ‘bubble_logged’. There should be only one, but jQuery doesn’t care. So, we need to find the first (and only) item in this collection. You can do that either by using $('#bubble_logged').get(0) or $('#bubble_logged')[0]. Once you do that, you have a reference to the DOM element that you were looking for.

    So, we add a .focus() to move the focus to that element. $('#bubble_logged').get(0).focus(); Note that this will attempt to focus the #bubble_logged element. If that is a div, it won’t do much. If you are trying to focus an element inside that container, you need to call focus on that instead.

    For the .hover() jQuery method, you are giving it two anonymous functions. The first is the hoverIn event handler and the second is the hoverOut event handler. I believe that you want the popup to fadein, then have the focus set. To do this, put both of those logic pieces in the first event handler.

    $('.disabled').hover (
        function () { 
            $('#bubble_logged').fadeIn(300, function(){
                //this is executed once the fadein is complete
                $('#bubble_logged')[0].focus();
            }); 
        },
        ...
    );
    

    Then, when the hoverOut method is called, you probably want to fadeOut the popup. Just add the following.

    $('.disabled').hover (
        ...
        function () { 
            $('#bubble_logged').fadeOut(300);
        }
    );
    

    The final script would look like this.

    $('.disabled').hover (
        function () { 
            $('#bubble_logged').fadeIn(300, function(){
                //this is executed once the fadein is complete
                $('#bubble_logged')[0].focus();
            }); 
        },
        function () { 
            $('#bubble_logged').fadeOut(300);
        }
    );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Problem: I can set the exposureMode property of AVCaptureDevice, but it does not stay
Problem: I have 2 classes, DB class and a User class, that will work
Problem Description: Multi-player Game that works over the some kind of network, in game
Problem: user made some selection in the multi-selection listbox, then pressed a checkbox, and
Problem: Trying to create a Mix that is applied to the AVPlayerItem, but it
Problem: I have a table that prints out vertical but I would like it
Problem: I am trying to build a recursive tree using a function and data
Problem occured when i tried to display xml data that has been taken by
Problem: I'm working on a website where there is a dial that displays a
Problem I have a xib file with a UIImageView over the top of the

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.