足球游戏_中国足彩网¥体育资讯$

仿百度谷歌搜索下拉框
来源:易贤网 阅读:893 次 日期:2016-06-22 09:42:44
温馨提示:易贤网小编为您整理了“仿百度谷歌搜索下拉框”,方便广大网友查阅!

仿百度,谷歌搜索下拉框 以下是代码,代码有待优化,本站原创

查看效果:仿百度谷歌搜索下拉框

<!doctype html public -//w3c//dtd html 4.01 transitional//en >

<html>

<head>

<title>仿百度搜索下拉框,放搜索下拉框,仿谷歌搜索下拉框 原创转载请注明</title>

<meta name="description" content="仿谷歌百度搜索下来内容显示,可以通过ajax下拉也可以调用数据库数据,目前只是按照js调用了点内容,参考下面代码进行自行修改 ">

<meta name="keywords" content="谷歌,百度,下拉框,仿搜索下拉,下拉框搜索,搜索下拉内容 ">

<style type=text/css>

body{

font-size:14px;}

</style>

<meta http-equiv=content-type content="text/html; charset=gbk"'foraspcn'></div>);

$(#foraspcn).css({width:+width_+px,position:absolute,z-index:999,list-style:none,border:solid #e4e4e4 1px,display:none});//这里设置列下拉层的样式,默认为隐藏的

});

//定义非开始运行函数

function delkeycode(keycode){//去除了不必要的按键反应,当比如删除,f1 f2等按键时,则返回

var array = new array();

array =[8,16,19,20,27,33,34,35,36,45,46,91,112,113,114,115,116,117,118,119,120,121,122,123,145,192];

for(i=0;i<array.length;i++){

if(keycode==array[i]){return true;break;}

}

return false;

}

//这是一个测试案例

function ajax_demo(){

var data_array = [网站制作学习网,网站制作,www.anypoetry.com];

for(i=0;i<data_array.length;i++){//这里进行数据附加 返回数据格式为 关键词数组

$(#foraspcn).append(<li style='width:+width_+px;'>+data_array[i]+</li>);

}

$(#foraspcn >li).mouseover(function(){$(this).css(background-color,li_color_);});

$(#foraspcn >li).mouseout(function(){$(this).css(background-color,li_color);});

$(#foraspcn >li).click(function(){$(input[name=key]).val($.trim($(this).text()));$(this).parent().hide();});

}

////////////////这里是正式的ajax调用

function ajax_getdata(key){

$.post(

ajax_tag_search.php,

{key:key},//ajax 的post不能提交中文提交,在动作页面进行获取后需要解码,注意字符格式,然后搜索后返回

function(data){//返回格式是json数据,至少是个数组也可自定义,然后再这里进行操作

data_array = eval((+data+));

for(i=0;i<data_array.length;i++)//这里进行数据附加 返回数据格式为 关键词数组

$(#foraspcn).append(<li style='width:+width_+px;'>+data_array[i]+</li>);

$(#foraspcn >li).mouseover(function(){$(this).css(background-color,li_color_);});

$(#foraspcn >li).mouseout(function(){$(this).css(background-color,li_color);});

$(#foraspcn >li).click(function(){$(input[name=key]).val($.trim($(this).text()));$(this).parent().hide();});

}

);

}

-->

</script>

<body>

仿百度百度搜索下拉<input type=text name=key size=40 maxlength=40>

</body>

</html>

中国足彩网信息请查看脚本栏目
上一篇:js操作下拉框
易贤网手机网站地址:仿百度谷歌搜索下拉框
由于各方面情况的不断调整与变化,易贤网提供的所有考试信息和咨询回复仅供参考,敬请考生以权威部门公布的正式信息和咨询为准!
关于我们 | 联系我们 | 人才招聘 | 网站声明 | 网站帮助 | 非正式的简要咨询 | 简要咨询须知 | 加入群交流 | 手机站点 | 投诉建议
工业和信息化部备案号:滇ICP备2023014141号-1 足球游戏_中国足彩网¥体育资讯$ 滇公网安备53010202001879号 人力资源服务许可证:(云)人服证字(2023)第0102001523号
云南网警备案专用图标
联系电话:0871-65317125(9:00—18:00) 获取招聘考试信息及咨询关注公众号:hfpxwx
咨询QQ:526150442(9:00—18:00)版权所有:易贤网
云南网警报警专用图标