`
xinlingwuyu
  • 浏览: 135685 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

select 按键 提示

阅读更多

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
 <HEAD>
  <TITLE> New Document </TITLE>
  <META NAME="Generator" CONTENT="EditPlus">
  <META NAME="Author" CONTENT="">
  <META NAME="Keywords" CONTENT="">
  <META NAME="Description" CONTENT="">
 </HEAD>

 <BODY>
 <script type="text/javascript">
  var currentIndex = 0;
  var currentChar = '';
 function CharPointItem()
 {
  //可以改成event.srcElement
  var ddl = document.getElementById("ddlItem");
  var itemCount = ddl.options.length;
  var selectStr = '';
  var laseIndex = currentIndex;
  var pressKey = String.fromCharCode(window.event.keyCode);
  if(itemCount <=1 || IsChar(pressKey)== false)
   return;
  if(pressKey != currentChar)
   currentIndex = 0;
  for(var i =currentIndex;i<itemCount;i++)
        {
            if(getpy(ddl.options[i].text.charAt(0))== pressKey)
            {
                currentChar = pressKey;
                ddl.selectedIndex = i;
                currentIndex = i + 1;
                break;
            }
        }
        currentIndex = laseIndex == currentIndex?0:currentIndex;
    }
   
    function IsChar(str)
    {
  t   =   str.charAt(0).toLowerCase();  
  if(t <= "z" && t >= "a")  
   return true;
  else  
   return false;
 }
 </script>
   
 <script type="text/vbscript">
 <!--
 function getpychar(char)
  tmp=65536+asc(char)
  if(tmp>=45217 and tmp<=45252) then
  getpychar= "A"
  elseif(tmp>=45253 and tmp<=45760) then
  getpychar= "B"
  elseif(tmp>=45761 and tmp<=46317) then
  getpychar= "C"
  elseif(tmp>=46318 and tmp<=46825) then
  getpychar= "D"
  elseif(tmp>=46826 and tmp<=47009) then
  getpychar= "E"
  elseif(tmp>=47010 and tmp<=47296) then
  getpychar= "F"
  elseif(tmp>=47297 and tmp<=47613) then
  getpychar= "G"
  elseif(tmp>=47614 and tmp<=48118) then
  getpychar= "H"
  elseif(tmp>=48119 and tmp<=49061) then
  getpychar= "J"
  elseif(tmp>=49062 and tmp<=49323) then
  getpychar= "K"
  elseif(tmp>=49324 and tmp<=49895) then
  getpychar= "L"
  elseif(tmp>=49896 and tmp<=50370) then
  getpychar= "M"
  elseif(tmp>=50371 and tmp<=50613) then
  getpychar= "N"
  elseif(tmp>=50614 and tmp<=50621) then
  getpychar= "O"
  elseif(tmp>=50622 and tmp<=50905) then
  getpychar= "P"
  elseif(tmp>=50906 and tmp<=51386) then
  getpychar= "Q"
  elseif(tmp>=51387 and tmp<=51445) then
  getpychar= "R"
  elseif(tmp>=51446 and tmp<=52217) then
  getpychar= "S"
  elseif(tmp>=52218 and tmp<=52697) then
  getpychar= "T"
  elseif(tmp>=52698 and tmp<=52979) then
  getpychar= "W"
  elseif(tmp>=52980 and tmp<=53640) then
  getpychar= "X"
  elseif(tmp>=53689 and tmp<=54480) then
  getpychar= "Y"
  elseif(tmp>=54481 and tmp<=62289) then
  getpychar= "Z"
  else '如果不是中文,则不处理
  getpychar=char
  end if
 end function

 function getpy(str)
  for i=1 to len(str)
   getpy=getpy&getpychar(mid(str,i,1))
  next
 end function
 //-->
 </script>
 <select ID="ddlItem" onKeyDown="CharPointItem()">
  <option value="">我们的世界</option>
  <option value="">您好</option>
  <option value="">小高</option>
  <option value="">才</option>
  <option value="">eeee</option>
 </select>
 </BODY>
</HTML>

分享到:
评论

相关推荐

    prompt-skeleton:CLI提示的行为一致

    使用prompt-skeleton项目提示: text-prompt tree-select-prompt cli-autocomplete switch-prompt 其他命令行界面: really-basic-chat-ui command-irail cli-2048 cli-minesweeper tiny-cli-editor 正在安装npm ...

    蔚蓝2000简易说明书.doc

    蔚蓝2000简易说明书 蔚蓝2000简易说明书 ;1. 清空灯台资料: 注意 !... 按E(SELECT; A; DMX; LINE)选择DMX输出线路 此时A---D键对应四个端口;用数字键盘把你想要的DMX通道的号码输入。屏幕上的初始号码为1,;;;

    HI-TECH PICC9.83(破解版)

    2、安装过程中,提示Select Activate PRO/Standard mode with serial number,随便输入,如111111等。注意把用邮件激活勾选上!! 3、依次点击NEXT,直至点击finish,完成。 4、双击破解软件 HI-TECH,提示打开激活...

    基于STM32F103的额温枪源码,包括了MXL90614数字式的传感器源码和MRT-311模拟量接口的源代码

    注:按键分为上、下、左、右按键 实现了测温功能、采集电压功能和预警处理提示功能 1、按左键,直接退出主界面 2、按右键,进入选择测温、测压界面 3、按住上键,进行测温,当出现发烧情况会蜂鸣器+红灯闪烁报警,...

    工业机器人编程与维护多选题.docx

    A、操作错误提示(正确答案) B、故障报警提示(正确答案) C、系统诊断提示(正确答案) D、运行提示(正确答案) E、开机提示 9、以下哪些是在程序中输入CALL指令的步骤?()。 A、按F1INST键(正确答案) B、选择CALL,按...

    Flashpaste 6.2中文版文本快速粘贴工具.rar

    在“first, select a language for the program interface:”选择“Chinese (PRC)”简体中文或“BIG5(Tranditional Chinese)”繁体中文然后按提示进行下面的初始配置即可。Flashpaste 为打字提供了一个...

    网页下拉框智能诱导输入用户只要输入下拉框选项每字的第一五笔或者拼音码,诱导框就会将最先匹配的n条记录

    * 的诱导功能可以通过ACTIVE_EN_QUICK_SELECT,ACTIVE_WB_QUICK_SELECT,ACTIVE_PY_QUICK_SELECT参数激活或关闭 * * 4)支持ie5.0 ie5.5 ie6.0 ~...,在ie5.0上,诱导提示窗口在浏览器的状态栏中,在ie5.5以上版本上...

    C学生成绩的管理系统小学期课程设计报告.doc

    /*显示提示信息*/ scanf("%d",&select); if(select==0) { if(saveflag==1) /*假设对链表的数据有修改且未进展存盘操作,则此标志为1*/ { getchar(); printf("\n=====&gt;是否保存修改记录文件"(y/n):"); scanf("%c",&...

    音乐盒设计(单片机课程设计)1.doc

    要求利用I/O口产生一定频率的方 波,驱动蜂鸣器,发出不同的音调并采用LCD显示信息,从而演奏乐曲(最少三首乐曲, 每首不少于30秒),开机时有英文欢迎提示字符,播放时显示歌曲序号(或名称),可 通过功能键选择...

    音乐盒设计(单片机课程设计).doc

    要求利用I/O口产生一定频率的方 波,驱动蜂鸣器,发出不同的音调并采用LCD显示信息,从而演奏乐曲(最少三首乐曲, 每首不少于30秒),开机时有英文欢迎提示字符,播放时显示歌曲序号(或名称),可 通过功能键选择...

    电话薄管理系统C语言

    void Wrong() /*输出按键错误信息*/ { printf("\n\n\n\n\n***********Error:input has wrong! press any key to continue**********\n"); getchar(); } void Nofind() /*输出未查找此记录的信息*/ { printf("\n====...

    技术培训——启谋篇

    1、pause&gt;nul 2、set /p a= pause 如何能让cmd命令行界面停在那里显示提示信息 处理文件的内容为: 文件表示:  echo off 不显示命令行  dir c:\*.* &gt;a.txt 将c盘文件列表写入a.txt  call c:\ucdos\ucdos.bat...

    设计方案.docx

    按键绑定: 11 3运行情况 13 1 分析 1.1 背景分析 只涉及到一个作业(进程),而且也没有特别提到说交换区的概念,我们只要把逻辑地址和实际的物理地址对应起来就可以了。主要是FIFO和LRU两种算法实现。 1.2 功能...

    C语言,通讯录管理程序设计

    void SelectSort(); void Wrong(); void Save(); void main() { RECORD tele[N]; /*定义RECOED结构体*/ FILE *fp; /*文件指针*/ int select; /*保持内选择结果变量*/ char ch; /*保存y,Y,n,N*/ int count=0;...

    电子万年历系统

    输出系统提供的功能选项 提示用户进行选择 void ListMonth int days int t ; 用来按规定格式输出一个月的日历 void Search1 void ; 用来显示一年12个月的日历 void Search2 void ; 用来显示某年某个月的日历 void ...

    软件工程工资管理系统

    8 非法请求 应用系统 系统管理员 非法请求提示信息 2.4安全性要求 访问数据库时需要输入登陆帐号和密码。在数据库内设有管理员表,登陆系统时会要求输入管理员帐号和密码。登陆模块根据输入帐号和密码查管理员表,...

    ExtJSWeb应用程序开发指南(第2版)

    3.2 信息提示框组件介绍 3.2.1 认识Ext.window.MessageBox 3.2.2 Ext.MessageBox.alert() 3.2.3 Ext.MessageBox.confirm() 3.2.4 Ext.MessageBox.prompt() 3.2.5 Ext.MessageBox.wait() 3.2.6 Ext....

    js使用小技巧

    事件按键 event.keyCode event.shiftKey event.altKey event.ctrlKey 事件返回值 event.returnValue 鼠标位置 event.x event.y 窗体活动元素 document.activeElement 绑定事件 document.capture...

    Excel VBA实用技巧大全 附书源码

    04153设定、删除单元格的输入规则和信息提示(有效性设置) 04154为单元格设置条件格式、删除条件格式 04155为单元格插入指向工作簿内部的超链接、删除超链接 04156为单元格插入指向工作簿外部的超链接、删除超链接 ...

    计算机应用技术(实用手册)

    此项目可选择硬盘开机的优先级,按下的按键,你可以进入它的子选单,它会显示出已侦测到可以让您选择开机顺序的硬盘,以用来启动系统。当然,这个选项要在你安装了两块或者两块以上的系统才能选择! HDD Change ...

Global site tag (gtag.js) - Google Analytics