网站地图
首页
php教程
asp.net教程
手机开发
css教程
网页制作
办公数码
jsp教程
asp教程
ps教程
当前位置:
编程学习网
>>
办公数码
>
excel
> >
[选择下拉列表框]选择下拉列表
[选择下拉列表框]选择下拉列表
发布时间:2016-11-28
【www.gdgbn.com--excel】
提示:您可以先修改部分代码再运行
下拉列表快速选择
<script type="text/javascript" language="JavaScript"> // 获取拼音首字母 function getPinYin(c) { execScript("tmp=asc(""+c+"")", "vbscript"); tmp = 65536 + tmp; if(tmp>=45217 && tmp<=45252) return "A"; if(tmp>=45253 && tmp<=45760) return "B"; if(tmp>=45761 && tmp<=46317) return "C"; if(tmp>=46318 && tmp<=46825) return "D"; if(tmp>=46826 && tmp<=47009) return "E"; if(tmp>=47010 && tmp<=47296) return "F"; if((tmp>=47297 && tmp<=47613) || (tmp == 63193)) return "G"; if(tmp>=47614 && tmp<=48118) return "H"; if(tmp>=48119 && tmp<=49061) return "J"; if(tmp>=49062 && tmp<=49323) return "K"; if(tmp>=49324 && tmp<=49895) return "L"; if(tmp>=49896 && tmp<=50370) return "M"; if(tmp>=50371 && tmp<=50613) return "N"; if(tmp>=50614 && tmp<=50621) return "O"; if(tmp>=50622 && tmp<=50905) return "P"; if(tmp>=50906 && tmp<=51386) return "Q"; if(tmp>=51387 && tmp<=51445) return "R"; if(tmp>=51446 && tmp<=52217) return "S"; if(tmp>=52218 && tmp<=52697) return "T"; if(tmp>=52698 && tmp<=52979) return "W"; if(tmp>=52980 && tmp<=53688) return "X"; if(tmp>=53689 && tmp<=54480) return "Y"; if(tmp>=54481 && tmp<=62289) return "Z"; return c.charAt(0); } // select helper SelectHelper = new function() { // 初始化 this.init = function() { document.attachEvent("onkeypress", function() { var elm = event.srcElement; if (elm.tagName == "SELECT" && elm.className.indexOf("SelectHelper") == -1) { elm.className += "SelectHelper"; elm.attachEvent("onkeypress", SelectHelper.getNextKeyItem); elm.fireEvent("onkeypress", event); } }); } // 获取选项文本的首字符 function getItemKeyChar(option) { return option.text.charAt(0).toUpperCase(); } // 查找并选中匹配的选项 this.getNextKeyItem = function() { var elm = event.srcElement; var index = elm.selectedIndex + 1; do { if (index == elm.length) index = 0; if (index == elm.selectedIndex) return false; // 未找到匹配的选项,则退出 } while (key2Char(event.keyCode) != getPinYin(getItemKeyChar(elm.options[index++]))); elm.selectedIndex = index - 1; // 选中匹配的选项 return false; // 取消原有的选择功能 } }; /** * 返回键盘事件对应的字母或数字 * a-z: 97 -> 122 * A-Z: 65 -> 90 * 0-9: 48 -> 57 */ function key2Char(key) { var s = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; if (key >= 97 && key <= 122) return s.charAt(key - 97); if (key >= 65 && key <= 90) return s.charAt(key - 65); if (key >= 48 && key <= 57) return "" + (key - 48); return null; } SelectHelper.init(); </script> 比如,某选项的拼音首字母为"a",只要按下键盘上的"a",就可以快速选择该项。
北京
上海
天津
重庆
河北
山西
内蒙古
辽宁
32
吉林
黑龙江
江苏
浙江
&^
安徽
福建
A1
江西
山东
河南
湖北
湖南
31
广东
广西
海南
A2
四川
贵州
云南
西藏
陕西
甘肃
宁夏
青海
新疆
香港
澳门
台湾
其它>
其它
北京
上海
天津
重庆
河北
山西
内蒙古
辽宁
32
吉林
黑龙江
江苏
浙江
&^
安徽
福建
A1
江西
山东
河南
湖北
湖南
31
广东
广西
海南
A2
四川
贵州
云南
西藏
陕西
甘肃
夏>宁
夏
青海
新疆
香港
澳门
台湾
其它
提示:您可以先修改部分代码再运行
本文来源:
http://www.gdgbn.com/bangongshuma/14503/
上一篇:
excel2007官方下载_Excel2007根据SQL语句生成透视图的一些关键点
下一篇:
[上下滚动代码]上下滚动
相关推荐
warning battery is critically low|Warning: mysql_num_rows():
ps日系风格照片|ps风格非主流 教程
css发动机|css常属性
做站选择题|做站选择那方面最好
【marquee boost】marquee的用法
如何调用存储过程返回值|如何调用存储过程
手机如何挣钱|网站如何挣钱
非主流签名火星文_非主流男生签名制作
warning battery is critically low_Warning: mssql_query() :
[对联广告图片]对联广告关闭代码
网友关注
sql server|sql 删除重复记录
【seo优化】SEO优化心得
【非主流浪漫爱情图片】ps制作非主流浪漫爱情图片
phpstudy|php 遍历目录
【ppt弹出效果】弹出层效果
怎么样去疤|怎么样去优化网站标题
文件上传漏洞_多文件上传类代码
alt是什么|alt边框美化代码
08年非主流歌曲_08非主流颓废美女图
phpstudy_php 文件上传类
热门标签
从下拉列表中选择怎么设置
access下拉列表选择
excel从下拉列表中选择
最新excel
excel
mysql导入excel表|mysql导入excel方法
excel
【excel长度超过255个字符】EXCEL长度超过255个字符导入SQL SERVER2005的方法
excel
asp.net core_ASP.NET Excel读写文件代码
excel
[phpstudy]php ExcelReader读取excel文件
excel
[asp.net core]asp.net 导出EXCEL文件二种方法
excel
【asp.net core】asp.net ajax下导出excel的解决办法
excel
【asp.net core】asp.net 导出excel与单元格中图片的方法:
excel
【php去除重复数据】php去除重复单词与取得所有链接 正则代码
excel
csrf-token|C#中dataset导出到excel
excel
.net导入excel时获取第一个sheet|.net导入excel时获取第一个Sheet名称
excel热门文章
exce
[上下滚动代码]上下滚动
exce
js判断字符串是否包含某个字符串|JSP 用Excel格式打开网页
exce
html 图片自适应大小_图片自适应大小
exce
[透明文本输入框]透明文本输入框
exce
excel菜单下拉键|下拉透明菜单
exce
简单php生成工具_简单php生成 execel表格 程序
exce
下拉菜单怎么做|下拉菜单
exce
多级下拉菜单怎么做_多级下拉菜单
exce
excel下拉菜单_类qq下拉菜单 代码
exce
【导航下拉菜单代码】导航下拉菜单 代码
声明:本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
Copyright©2006-2019 编程学习网 www.gdgbn.com 版权所有