ITPub博客

首页 > IT职业 > IT图书 > DOM事件探秘--编程挑战

DOM事件探秘--编程挑战

IT图书 作者:jasonhsp 时间:2021-09-09 09:00:07 0 删除 编辑





下拉菜单
divselect {
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 

}





请选择分类

  • ASP开发

  • .NET开发

  • PHP开发

  • Javascript开发

  • Java特效




来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/615/viewspace-2798493/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2019-04-12

  • 博文量
    342
  • 访问量
    2720