为了账号安全,请及时绑定邮箱和手机立即绑定

求,提示这个是我哪里错了呀?怎么改?Uncaught TypeError: Cannot set property 'onmouseover' of null

<script type="text/javascript">

window.onload = function(){

var chgOpacity=document.getElementById('chgOpacity');

oShareSide.onmouseover = function (){

startMove(0);

}

oShareSide,onmouseout = function(){

startMove(-200);

}

}

var chgOpacity=document.getElementById('chgOpacity');

chgOpacity.onmouseover = function (){

startChgOpac(100);

}

chgOpacity.onmouseout = function(){

startChgOpac(30);

}

var doing = null;

var alpha = 30;

function startChgOpac(iTarget){

clearInterval(doing);

doing = setInterval(function(){

var speeds = 0;

if (alpha > iTarget) {

speeds = -10 ;

}else{

speeds = 10;

}

if(alpha == iTarget){

clearInterval(doing);

}else{

alpha += speeds;

chgOpacity.style.filter='alpha(opacity='+alpha+')';

chgOpacity.style.opacity = alpha/100;

}

},30);

}


正在回答

2 回答

1.var chgOpacity=document.getElementById('chgOpacity');

oShareSide.onmouseover = function (){     //oShareSide.onmouseover 改为chgOpacity.onmouseover 

2.oShareSide  //这个变量没有声明过,所以oShareSide.onmouseover为null。


0 回复 有任何疑惑可以回复我~
#1

xld 提问者

非常感谢!
2016-06-06 回复 有任何疑惑可以回复我~

oShareSide哪取得?

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

求,提示这个是我哪里错了呀?怎么改?Uncaught TypeError: Cannot set property 'onmouseover' of null

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信