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.
- What is the jQuery, html and css behind it?
- Does it replace or expand over the links?
- Is there an other additional functionality I’ve missed?
How you can retrive the jQuery code of the search textbox?
This is the
<input>:With little jQuery code (and knowing what you’re doing), you can pull the event handlers:
In that object you can see they have two handlers, one for
keydownand one forfocusout.It’s minified, but you can understand it if you wish:
keydown:
focusout:
Indented version:
keydown:
focusout:
This answer shows you you can achieve anything you want in the WEB development.
NOTHING IS SECRET!