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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T02:08:53+00:00 2026-06-06T02:08:53+00:00

How does the stack overflow search input at the top works? It seems to

  • 0

How does the stack overflow search input at the top works? It seems to expand random or when it’s empty and backspace is hit.

  1. What is the jQuery, html and css behind it?
  2. Does it replace or expand over the links?
  3. Is there an other additional functionality I’ve missed?
  • 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-06-06T02:08:56+00:00Added an answer on June 6, 2026 at 2:08 am

    How you can retrive the jQuery code of the search textbox?

    This is the <input>:

    <input autocomplete="off" name="q" class="textbox" placeholder="search" tabindex="1" type="text" maxlength="140" size="28" value="">
    

    With little jQuery code (and knowing what you’re doing), you can pull the event handlers:

    $('.textbox[name="q"]').data('events')//Here jQuery saves internally the handlers
    

    In that object you can see they have two handlers, one for keydown and one for focusout.

    It’s minified, but you can understand it if you wish:

    keydown:

    function (c){if(k||46>c.keyCode&&8!=c.keyCode&&32!=c.keyCode)return!0;k=!0;clearTimeout(e);d.clearQueue("expand");h(function(c){d[0].placeholder="";a.fadeOut(100,c)});h(function(c){d.animate({width:f,"max-width":f},100,c)});h(function(){0==d.parent().find(".search-prompt").length&&d.before('<span class="search-prompt">search:</span>')});3==d.queue("expand").length&&d.dequeue("expand")}
    

    focusout:

    function (){e=setTimeout(function(){h(function(c){d.parent().find(".search-prompt").remove(); c()});h(function(a){d.animate({width:c,"max-width":c},100,a)});h(function(c){n&&""==d[0].value&&(d[0].value="search");d[0].placeholder="search";a.fadeIn(100,c)});3==d.queue("expand").length&&d.dequeue("expand");k=!1},200)}
    

    Indented version:

    keydown:

    function(c) {
        if (k || 46 > c.keyCode && 8 != c.keyCode && 32 != c.keyCode) return !0;
        k = !0;
        clearTimeout(e);
        d.clearQueue("expand");
        h(function(c) {
            d[0].placeholder = "";
            a.fadeOut(100, c)
        });
        h(function(c) {
            d.animate({
                width: f,
                "max-width": f
            }, 100, c)
        });
        h(function() {
            0 == d.parent().find(".search-prompt").length && d.before('<span class="search-prompt">search:</span>')
        });
        3 == d.queue("expand").length && d.dequeue("expand")
    }​
    

    focusout:

    function() {
        e = setTimeout(function() {
            h(function(c) {
                d.parent().find(".search-prompt").remove();
                c()
            });
            h(function(a) {
                d.animate({
                    width: c,
                    "max-width": c
                }, 100, a)
            });
            h(function(c) {
                n && "" == d[0].value && (d[0].value = "search");
                d[0].placeholder = "search";
                a.fadeIn(100, c)
            });
            3 == d.queue("expand").length && d.dequeue("expand");
            k = !1
        }, 200)
    }​    
    

    This answer shows you you can achieve anything you want in the WEB development.
                    NOTHING IS SECRET!

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

Sidebar

Related Questions

How does Stack Overflow show the revision changes in the diff-like format they use?
So I read MSDN and Stack Overflow. I understand what the Action Delegate does
Possible Duplicate: What does ^ in objective C mean? [SKSite requestSiteWithNameLike:@Stack Overflow completionHandler:^(SKSite *site,
I want to make an ajax auto complete field like stack overflow's tag search
Firstly, I have search Stack Overflow for the answer, but I have not found
Does anyone know if the problems that have been affecting Stack Overflow with regards
Search for a term on amazon.com, for example stack overflow, and the search results
When you search Stack Overflow, Sphinx will not bring up results that match Stackoverflow
So far search on Stack Overflow I havent found a situation that is like
Why does this code not print an exception stack trace? public class Playground {

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.