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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T17:34:56+00:00 2026-05-11T17:34:56+00:00

I have a popup search box that is shown when the user mouses over

  • 0

I have a popup search box that is shown when the user mouses over a hyperlink, when the user mouses out of the search box, the box disappears. This works fine. When the textbox has focus, the search box is supposed to stay visible until the textbox loses focus, at which time the box will hide if the cursor is not over the box. This works well in all browsers except IE (IE7 to be specific). In IE, the blur event of the textbox is fired on mouseout of the textbox effectively hiding the search box. Here is the code I have written:

<script type="text/javascript">
    $(document).ready(function() {
         //add mouseover event to the search button to show the search box
        $(".search").mouseover(
            function() {
                $(".open").show();
            });

        //add mouseout event to the search button to show the hide box
        $(".search").mouseout(
            function() {
                $(".open").hide();
            });

        //add mouseover event to the search box so it doesnt hide when the user attempts to click the box
        $(".open").mouseover(
            function() {
                $(".open").show();
            });

        //add mouseout event to the search box so it doesnt hides when the users mouse exits the box
        $(".open").mouseout(
            function() {
                $(".open").hide();
            });

        //don't ever hide the search box when the textbox has focus
        $("#tbSearch").focus(
            function() {
                $(".open").mouseout(
                    function() {
                        $(".open").show();
                    });
            });

        //hide the search box when the textbox loses focus
        $("#tbSearch").blur(
            function() {
                $(".open").hide();
                $(".open").mouseout(
                    function() {
                        $(".open").hide();
                    });
            });


    });
</script>

And here is the HTML:

<a class="search" href="#"><span>Search</span></a>
<div class="open">
    <input id="tbSearch" type="text" />
    <a class="go" href="#"><span>Go</span></a>
</div>
  • 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-11T17:34:56+00:00Added an answer on May 11, 2026 at 5:34 pm

    The problem seems to be that you are rebinding events without unbinding them. So, there ends up being multiple events that fire showing and hiding the box depending on how many times the focus and blur event have happened. I am not exactly sure why it is failing in IE for some reason, but the solution seems to have too many moving parts so it is hard to tell exactly where it is failing.

    I have been able to get this type of thing to work in the past by using an attribute that maintains the state of the textbox (focused or blurred). Try this out:

    <script type="text/javascript">
    
    $(function() {
    
    var showBox = function() {
        $(".open").show();
    };
    var hideBox = function() {
        if (!$(".open").attr("searching")) {
            $(".open").hide();
        }
    };
    
    $(".search").hover(showBox, hideBox);
    $(".open").hover(showBox, hideBox).hide();
    
        $("#tbSearch").focus(function() {
        $(".open").attr("searching", "true");
        }).blur(function() {
        $(".open").removeAttr("searching");
        $(".open").hide();
    });
    });
    
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a popup function in a program that works well, be re-loads the
I have a popup menu that has a few items in it. Option 1
I have a Popup defined like this: <Popup Name=myPopup StaysOpen=True Placement=Bottom PlacementRectangle=0,20,0,20 PlacementTarget={Binding ElementName=myPopupAnchor}>
I have a popup select box in a form in my jQuery Mobile application.
I have 1st popup, and this 1st popup opens 2nd popup Code: <view-state id=paneMaintenance
I like to have a popup modal dialog that need to show the list
I want it to have a popup dialog javascript box. Instead of a new
I have a live search input that shows results and lets you use the
I have tried to search before i made a decision to create this new
I have a button that needs to open a new window as a popup

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.