代码实例:
无标题文档*{ margin:0; padding:0;}
#ul1{ width:1000px; height:30px;}
#ul1 li{
list-style:none;
width:100px;
height:30px;
background: #cccccc;
color:white; border:1px #000 solid;
float:left;
line-height:30px;
text-align:center;
}
window.onload = function(){
var aLi = document.getElementsByTagName('li');
var oA = document.getElementById('a1');
for(var i=0;i
aLi[i].οnmοuseοver= function(){
//this.getAttribute('au');
//字符串拼接的方式,获取不同的地址
oA.src = this.getAttribute('au')+'.mp3';
//播放
oA.play();
};
}
};
- 首页
- 视频
- 课程
- 职业
- 企业
- 社区
- 会员
效果:
、
编辑的文件
2017-09-03 20:44:37