【推荐】带智能提示的百度搜索框 —— 新:JS压缩更精简!

随着GOOGLE有了智能提示后,百度也不甘心,于是今天我也模仿了一个,发给大家分享!!!

前天发布一个5款超级漂亮百度及尊和搜索框代码 ,今天再发带智能提示的

 

 

Code
<html>
  
  
<head>
    
<meta http-equiv=Content-Type content="text/html;charset=gb2312">
    
<title>百度搜索框,带智能提示</title>
<style>td,a{font-family:arial}#kw{font:16px Verdana;height:1.78em;padding-top:2px}#b{height:30px;padding-top:4px}#b,#b 0 3px!important;margin:0 0 10px}#sb{height:2em;width:5.6em}#km{height:50px}#l{margin:0 0 5px 15px}#l td{padding-left:107px}p,table{width:650px;border:0}#l td,#sb,#km{font-size:14px}#l a,#l b{margin-right:1.14em}a{color:#00c}a:active{color:#f60}#hp{position:absolute;margin-left:6px}#lg{margin:-26px 0-44px}#lk{width:auto;line-height:18px;vertical-align:top}form{position:relative;z-index:9}</style>

  
</head>
  
<body>




----把下面的代码放到需要的地方

<form name=f action=http://www.baidu.com/s><input type=text name=wd id=kw size=35 maxlength=100><input type=hidden name=tn value="jqshw_pg"><input type=hidden name=bar value=""><input type=submit value=百度一下 id=sb></form>
----把上面的代码放到需要的地方

  
</body>




----把下面的代码放到文件末尾

<script>
 var w = document.f.wd;
 function s(o) {
  if (w.value.length > 0) {
 var h = o.href;
 var q = encodeURIComponent(w.value);
 if (h.indexOf("q=") != -1) {
  o.href = h.replace(new RegExp("q=[^&$]*"), "q=" + q)
 } else {
  o.href += "?q=" + q
 }
  }
 }; (function() {
  if (new RegExp("q=([^&]+)").test(location.search)) {
 w.value = decodeURIComponent(RegExp.$1)
  }
 })();
  document.write('<script src=http://www.baidu.com/js/bdsug.js?v=1.1.0.3><\/script>')
 window.onunload = function() {};
 </script>
 <script>
 w.focus()
 </script>

</html>
posted @ 2009-06-07 21:08  数字人 - 黑色风衣  阅读(1171)  评论(1编辑  收藏  举报