各位大侠,帮帮忙啊,关于下拉列表框弹出列表的问题,拜托了啊。 获得下拉列表框的焦点后,怎样使用快捷键(如F8)选中下拉列表框(selet)的选项,而代替鼠标点击,选中各个选项。用快捷键F8(不用默认的方向键上下移动选中各选项)选中选项,最好能够使select弹出下拉列表(达到和鼠标同样的效果) 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 帅帅的宝宝作品必定全部代码,做了一天了!请速给分,谢谢配合<!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><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><style>.content{ font-size:13px; text-indent :8px;}#a{ float:left; width:30px; text-align:center; border:0; position:relative; bottom:-2px; position:relative; left:3px; font-size:13px;}#b{ position:relative; left:3px;}.cs1{ border:1px solid blue; width:55px;}.cs2{ border:1px solid black; width:55px;} </style><title>无标题文档</title></head><body><div class="cs1" id="cs1"><input id="a" type="text" value="123" align="center" size="20" unselectable="on" \><div id="b"><img src="1\button1.gif" \></div></div><div class="cs2" id="cs2" style="display:none"><div class="content" id="1" style="background-color:RGB(49,106,197);border:1px dashed #999999;color:#FFFFFF;">123</div><div class="content" id="2" >456</div><div class="content" id="3" >789</div></div><script type="text/javascript">document.getElementById("a").onkeydown = function(){ if(event.keyCode == 119){ //document.getElementById("a").value=document.getElementById("1").innerText; document.getElementById("cs2").style.display="block"; } else if(event.keyCode == 40){ for(i=1;i<=2;i++){ if(eval("document.getElementById('" + i + "')").style.backgroundColor == "rgb(49,106,197)"){ with(eval("document.getElementById('" + i + "')").style){ background = "";color = "";border=""; } with(eval("document.getElementById('" + parseInt(i+1) + "')").style){ backgroundColor = "rgb(49,106,197)";color = "#FFFFFF";border="1px dashed #999999"; } break; } } } else if(event.keyCode == 38){ for(i=3;i>=2;i--){ if(eval("document.getElementById('" + i + "')").style.backgroundColor == "rgb(49,106,197)"){ with(eval("document.getElementById('" + i + "')").style){ background = "";color = "";border=""; } with(eval("document.getElementById('" + parseInt(i-1) + "')").style){ backgroundColor = "rgb(49,106,197)";color = "#FFFFFF";border="1px dashed #999999"; } break; } } } else if(event.keyCode == 13){ for(i=1;i<=3;i++){ if(eval("document.getElementById('" + i + "')").style.backgroundColor == "rgb(49,106,197)"){ document.getElementById("a").value = eval("document.getElementById('" + i + "')").innerText; document.getElementById("cs2").style.display="none"; break; } } } }; </script> </body></html> 说明:获得焦点后(鼠标和Tab都可以),按F8弹出下拉框,上下键选择,回车确定! 快捷键是 alt+上箭头或下箭头 发现一个问题,你没法看到我的图片!因为图片是特殊的,要图片可以+我msn:[email protected] 有一个js获取当前地址的问题 js取servlet传过来的参数问题 链接时如何传递参数? 有没有哪位大哥做过widget开发? 路径中的"\"如何原样输出? 高手!看你们能不能解决这个问题!谢谢! html表单提交,jsp如何处理 js中怎么控制添加到<textarea>中文字的颜色呢? 关于触控切换选项卡的问题 有左右两个框架,如何在左框架里点击一个按钮,使右框架的表单FORM1提交 上海500强企业诚聘开发LEADER 3名 怎么让iframe里的页面后退????
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<style>
.content{
font-size:13px;
text-indent :8px;
}
#a{
float:left;
width:30px;
text-align:center;
border:0;
position:relative; bottom:-2px;
position:relative; left:3px;
font-size:13px;
}
#b{
position:relative; left:3px;
}
.cs1{
border:1px solid blue; width:55px;}
.cs2{
border:1px solid black;
width:55px;
}
</style>
<title>无标题文档</title>
</head>
<body>
<div class="cs1" id="cs1">
<input id="a" type="text" value="123" align="center" size="20" unselectable="on" \>
<div id="b"><img src="1\button1.gif" \></div>
</div>
<div class="cs2" id="cs2" style="display:none">
<div class="content" id="1" style="background-color:RGB(49,106,197);border:1px dashed #999999;color:#FFFFFF;">123</div>
<div class="content" id="2" >456</div>
<div class="content" id="3" >789</div>
</div>
<script type="text/javascript">document.getElementById("a").onkeydown = function(){
if(event.keyCode == 119){
//document.getElementById("a").value=document.getElementById("1").innerText;
document.getElementById("cs2").style.display="block";
}
else if(event.keyCode == 40){
for(i=1;i<=2;i++){
if(eval("document.getElementById('" + i + "')").style.backgroundColor == "rgb(49,106,197)"){
with(eval("document.getElementById('" + i + "')").style){
background = "";color = "";border="";
}
with(eval("document.getElementById('" + parseInt(i+1) + "')").style){
backgroundColor = "rgb(49,106,197)";color = "#FFFFFF";border="1px dashed #999999";
}
break;
}
}
}
else if(event.keyCode == 38){
for(i=3;i>=2;i--){
if(eval("document.getElementById('" + i + "')").style.backgroundColor == "rgb(49,106,197)"){
with(eval("document.getElementById('" + i + "')").style){
background = "";color = "";border="";
}
with(eval("document.getElementById('" + parseInt(i-1) + "')").style){
backgroundColor = "rgb(49,106,197)";color = "#FFFFFF";border="1px dashed #999999";
}
break;
}
}
}
else if(event.keyCode == 13){
for(i=1;i<=3;i++){
if(eval("document.getElementById('" + i + "')").style.backgroundColor == "rgb(49,106,197)"){
document.getElementById("a").value = eval("document.getElementById('" + i + "')").innerText;
document.getElementById("cs2").style.display="none";
break;
}
}
}
};
</script>
</body>
</html>