网页嵌入百度搜索,谷歌搜索下拉选择直接搜索
2013-08-18 21:54
751 查看
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>qqqun21/777/12</title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"/> <style> #divselect{ margin:0px; position:relative; z-index:10000; background: #fff;} #divselect input{height:20px; line-height:20px; border:1px solid grey; float:left; padding:0px; margin:0px;} #divselect span{height:20px; line-height:20px; border:1px solid grey; float:left; padding:0px; margin:0px;} #divselect ul{margin:0px; float:left; width:150px; border-left:0px; border-right:0px; padding:0px;} #divselect ul li{margin:0px; height:20px; line-height:20px; border-top:0px; border-bottom:1px solid grey; border-left:1px solid grey; border-right:1px solid grey; display: none; cursor: pointer;} #divselect ul img{ height:19px; width:50px; } </style> <script> function showIt(){ var lis = document.getElementsByName('myLis'); for(var i=1;i<lis.length;i++){ if(lis[i].style.display==""){ lis[i].style.display="block"; }else{ lis[i].style.display=""; } } } function hideIt(){ var lis = document.getElementsByName('myLis'); for(var i=1;i<lis.length;i++){ lis[i].style.display=""; } } function sosoIt(obj){ var wd = document.getElementById("wd").value; if(obj==1){ window.open("http://www.baidu.com/s?wd="+wd) } if(obj==2){ window.open("http://www.sogou.com/web?query="+wd) } if(obj==3){ window.open("http://www.google.com.hk/search?newwindow=1&safe=strict&site=webhp&q="+wd) } } </script> </head> <body> <div id='divselect'> <input type="text" id="wd" style="border-right:0px;"/> <ul id="selectUl"> <li name="myLis" style="display:block;border-top:1px solid grey;" onclick="sosoIt(1)">百度搜索<img src="http://img.baidu.com/img/logo-80px.gif" border="0"/></li> <li name="myLis" onclick="sosoIt(2)">搜狗搜索<img src="http://www.sogou.com/images/logo_l.gif"border="0" alt="Google"/></li> <li name="myLis" onclick="sosoIt(3)">谷歌搜索<img src="http://www.google.com/logos/Logo_40wht.gif"border="0" alt="Google"/> </li> </ul> <span onclick="showIt()" style="border-left:0px;">▼</span> </div> </body>
大致粗糙的实现了下。
Java学习交流群: 2177712
相关文章推荐
- 在网页中嵌入百度、谷歌搜索(Web搜索与站内搜索)
- 可切换搜索引擎的导航网页搜索框,可以换百度、谷歌、搜狗不同的搜索方式
- 网页中嵌入GOOGLE、百度搜索
- 怎样在自己的网页中嵌入百度搜索功能
- 网页中嵌入百度搜索栏代码
- 网页中嵌入百度搜索栏代码
- 网页嵌入百度搜索条(含站内搜索功能)
- 谷歌在搜索结果中直接标记网页在移动端是否友好
- 百度加强搜索结果摘要:增加页内命名锚链接直接指向网页段落
- word右键添加百度谷歌搜索,word右键添加打开某个文件夹选项
- 在网页中嵌入Google搜索(站内搜索)
- 百度面试-网页搜索部
- 如何在百度搜索中自动显示有趣的网页动态效果
- 同一时间 同一区域用百度或谷歌搜索 排名为什么不一样 seo
- 其他网页可以使用,但百度首页打不开,百度搜索无法使用,怎么办
- 模仿百度空格间隔搜索,匹配选择项目
- 百度关键词搜索量查询,百度,谷歌关键词查询工具
- 百度开源其NLP主题模型工具包,文本分类等场景可直接使用L——LDA进行主题选择本质就是降维,然后用于推荐或者分类
- 百度搜索的嵌入代码
- java做百度、谷歌等各大搜索引擎 搜索功能