首页 > IT职业 > IT图书 > DOM事件探秘--编程挑战
width: 186px;
margin: 80px auto;
position: relative;
z-index: 10000;
} / 选择框 /
divselect cite {width: 184px;
height: 24px;
line-height: 24px;
display: block;
color: #807a62;
cursor: pointer;
font-style: normal;
text-indent:1em;
border: 1px solid gray;
background: url(xjt.png) no-repeat right center;
} / 选项项样式 /
divselect ul{display:none;
width: 184px;
border: 1px solid gray;
border-top:none;
} divselect ul li{ cursor: pointer;
list-style:none;
text-indent:1em;
height: 24px;
line-height: 24px;
}
/* 点击页面空白地方,选择框消失 */
document.onclick = function () {
oUl.style.display = 'none';
litxt = null;
}
/* 鼠标浮动在每个选择项上面时,背景颜色改变 */
for (var i = 0, l = oLis.length; i oLis.length-1) {
x = 0;
}
oLis[x].style.background = 'silver';
oLis[y].style.background = '#fff';
litxt = oLis[x].innerHTML;
}
//按下向上键
if (e.keyCode == 38) {
oUl.style.display = 'block';
x = x - 1;
if (x }
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/615/viewspace-2798493/ ,如需转载,请注明出处,否则将追究法律责任。