最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

js實(shí)現(xiàn)百度搜索提示框

 更新時(shí)間:2017年02月05日 09:32:25   作者:qq2020  
本文主要分享了js實(shí)現(xiàn)百度搜索提示框的示例代碼,具有很好的參考價(jià)值,下面跟著小編一起來看下吧

效果如下所示

話不多說,請(qǐng)看代碼:

<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>百度搜索提示框</title>
<style>
* { margin: 0;padding: 0; outline: none;}
.search101 {
 width: 650px;
 margin: 300px auto;
 font-size: 0;
} 
.sou1 { 
 width: 514px;
 height: 40px;
 color: #666;
 font: 16px Microsoft YaHei;
 border: 1px solid rgba(170,170,170,.9);
 border-right: 0;
 border-radius: 2px 0 0 2px;
 background: rgba(255,255,255,.9);
 padding: 0 30px 0 3px; 
 vertical-align: top; 
 display: inline-block;
 transition: .2s; 
}
.sou2 { 
 width: 100px;
 height: 42px;
 font: 16px Microsoft YaHei;
 color: rgba(255,255,255,.9); 
 background: rgba(0,170,240,1);
 border: 0;
 border-left: 1px solid rgba(0,170,240,1);
 border-radius: 0 2px 2px 0;
 margin: 0 0 0 -1px;
 vertical-align: top;
 transition: .3s;
 display: inline-block;
 cursor: pointer;
}
.sou2:hover {
 background: rgba(0,140,220,.9);
}
.sou1:focus {
 color: #333; 
 border: 1px solid rgba(0,170,240,1);
 border-right: none;
}
</style>
</head>
<body>
 <div class="search101">
 <form action="http://www.baidu.com/baidu" class="search-form" method="" id="search-form">
  <input id="ipt1" name="tn" type="hidden" value="baidu" >
  <input type="text" id="sou1" class="sou1" name="word" maxlength="8048" value="" placeholder="" baiduSug=1 onmouseover="focus()">
  <input type="submit" class="sou2" value="百度一下" >
 </form>
 </div>
<!-- 百度搜索提示 -->
<script charset="gbk" src="http://www.baidu.com/js/opensug.js"></script> <!-- we124.com/libs/js/opensug.js(無logo) -->
<script> 
 document.getElementById("sou1").focus(); 
 var txtObj = document.getElementById("alertSpan");
 //回調(diào)函數(shù),用于獲取用戶當(dāng)前選擇的文字
 function show(str){
 txtObj.innerHTML = str;
 }
 var params = {
 "XOffset": 0,   //提示框位置橫向偏移量,單位px
 "YOffset": 0,   //提示框位置縱向偏移量,單位px
 "width": 204,   //提示框?qū)挾?,單位px
 "fontColor": "#666",  //提示框文字顏色
 "fontColorHI": "#222",  //提示框高亮選擇時(shí)文字顏色
 "fontSize": "16px",  //文字大小
 "fontFamily": "微軟雅黑", //文字字體
 "borderColor": "#d8d8d8", //提示框的邊框顏色
 "bgcolorHI": "#e8e8e8",  //提示框高亮選擇的顏色
 "sugSubmit": true,  //在選擇提示詞條是是否提交表單 
 };
 BaiduSuggestion.bind("ipt1",params,show); 
</script> 
</body>
</html> 

以上就是本文的全部?jī)?nèi)容,希望本文的內(nèi)容對(duì)大家的學(xué)習(xí)或者工作能帶來一定的幫助,同時(shí)也希望多多支持腳本之家!

相關(guān)文章

最新評(píng)論

东宁县| 大埔县| 金溪县| 灌阳县| 类乌齐县| 广河县| 新安县| 汤阴县| 汨罗市| 巴林左旗| 宜春市| 郎溪县| 东港市| 内丘县| 依兰县| 化隆| 唐海县| 左贡县| 津市市| 阿尔山市| 邢台市| 九龙坡区| 宜都市| 阿拉善左旗| 道孚县| 烟台市| 凉山| 巩留县| 龙州县| 虹口区| 眉山市| 绥中县| 越西县| 连山| 玉山县| 昌吉市| 嘉善县| 铜川市| 运城市| 宜城市| 东兴市|