爱问知识人 爱问教育 医院库

什么是文本框获取焦点弹出下拉框?

首页

什么是文本框获取焦点弹出下拉框?

什么是文本框获取焦点弹出下拉框?

提交回答

全部答案

    2018-10-27 18:46:50
  •   script LANGUAGE=JavaScriptvar oRegion = document。getElementById(txtRegion); //需要弹出下拉列表的文本框var oDivList = document。getElementById(divList); //要弹出的下拉列表var oClose = document。
      getElementById(tdClose);   //关闭div的单元格,也可使用按钮实现var colOptions = document。getElementsByTagName(li); //所有列表元素var bNoAdjusted = true;oClose。
      onclick = function(){ oDivList。style。display = none;  //隐藏div,实现关闭下拉框的效果};//设置下列选择项的一些事件for (var i=0; icolOptions。length; i++){ colOptions[i]。
      style。cursor = hand; colOptions[i]。onclick = function()   //为列表项添加单击事件 { oRegion。value = this。innerText; }; colOptions[i]。
      onmouseover = function() //为列表项添加鼠标移动事件 { this。style。backgroundColor = #ffff00; }; colOptions[i]。onmouseout = function() //为列表项添加鼠标移走事件 { this。
      style。backgroundColor = ; };}//文本获得焦点时的事件oRegion。onfocus = function(){ oDivList。style。display = block; if (bNoAdjusted)  //控制div是否已经显示的变量 { bNoAdjusted = false; //设置下拉列表的宽度和位置 oDivList。
      style。width = this。offsetWidth + 50; oDivList。style。posTop = oDivList。offsetTop + this。offsetHeight; oDivList。style。posLeft = oDivList。
      offsetLeft - this。offsetWidth - 8; }};/script/body/html。

    端***

    2018-10-27 18:46:50

类似问题

换一换
  • 操作系统/系统故障 相关知识

  • 电脑网络技术
  • 电脑网络

相关推荐

正在加载...
最新资料 推荐信息 热门专题 热点推荐
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200

热点检索

  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
返回
顶部
帮助 意见
反馈

确定举报此问题

举报原因(必选):