首页 > 其他 > 详细

index的用法

时间:2015-08-17 23:29:40      阅读:476      评论:0      收藏:0      [点我收藏+]

示例1:window.onload=function(){
var oPf=document.getElementById(‘pingfen‘);
var aLi=oPf.getElementsByTagName(‘li‘);
var i=0;

for(i=0;i<aLi.length;i++){
aLi[i].index=i;
aLi[i].onmouseover=function(){
for(i=0;i<aLi.length;i++){
if(i<=this.index)
{
aLi[i].style.background="url(star.gif) no-repeat 0 -29px";
}
else
{
aLi[i].style.background="url(star.gif) no-repeat 0 0";
}
}
};

aLi[i].onmousedown=function ()
{
alert(‘提交成功:‘+(this.index+1)+‘分‘);
};
}
};

index的用法

原文:http://www.cnblogs.com/hyperz/p/4737993.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!