1

Possible Duplicates:
How would I implement stackoverflow’s hovering dialogs?
i want a small box like stackoverflow

did you see the box in the top is each page i want do one how

Community
  • 1
  • 1
Mostafa Elkady
  • 5,645
  • 10
  • 45
  • 69
  • 1
    Could you please clarify your question? – Harmen Feb 24 '10 at 19:50
  • http://stackoverflow.com/questions/1889403/i-want-a-small-box-like-stackoverflow-closed and http://stackoverflow.com/questions/659199. – Matt Ball Feb 24 '10 at 19:50
  • @Tim: well the question is "did you see the box in the top is[sic] each page".. the correct answer would probably be "yes, I have" – Jimmy Feb 24 '10 at 19:51

2 Answers2

2

They are doing 2 things:

1) They have a background image which is why the little magnifying glass appears:

#hsearch .textbox {
    background:url("http://sstatic.net/so/Img/search.png") no-repeat scroll left center #FFFFFF;
    border-color:#CCCCCC -moz-use-text-color -moz-use-text-color #CCCCCC;
    border-right:medium none;
    border-style:solid none none solid;
    border-width:1px medium medium 1px;
    margin:0;
    max-width:230px;
    padding-left:16px;
}

2) When you click on the box, if the content says "search", then it's blanked out. This is done by simple javascript:

<input name="q" class="textbox" tabindex="1" 
    onfocus="if (this.value=='search') this.value = ''" 
    type="text" maxlength="80" size="28" value="search"> 
Keltex
  • 26,220
  • 11
  • 79
  • 111
0

You mean like on the front page of this site ?

(It'd be a lot more helpful if you were specific.)

In my case I used the activebar plugin