Microsoft JScript 运行时错误: 无法设置属性“onclick”的值: 对象为 null 或未定义
function$(e){returndocument.getElementById(e);}document.getElementsByClassName=functi...
function $(e){return document.getElementById(e);}
document.getElementsByClassName=function(cl){
var retnode=[];
var myclass=new RegExp('\\b'+cl+'\\b');
var elem=this.getElementsByTagName('*');
for(var i=0;i<elem.length;i++){
var classes=elem[i].className;
if(myclass.test(classes))
retnode.push(elem[i]);
}
return retnode;
}
var MyMar;
var speed=1;
var spec=1;
var ipath='images/';
var thumbs=document.getElementsByClassName('thumb_img');
for(var i=0;i<thumbs.length;i++){
thumbs[i].onmouseover=function(){
$('main_img').src=this.rel;
$('main_img').link=this.link;
};
thumbs[i].onclick=function(){
location=this.link;
}
}
$('main_img').onclick=function(){
location=this.link;
}
$('gotop').onmouseover=function(){
this.src=ipath+'gotop2.gif';
MyMar=setInterval(gotop,speed);
}
$('gotop').onmouseout=function(){
this.src=ipath+'gotop.gif';
clearInterval(MyMar);
}
$('gobottom').onmouseover=function(){
this.src=ipath+'gobottom2.gif';
MyMar=setInterval(gobottom,speed);
}
$('gobottom').onmouseout=function(){
this.src=ipath+'gobottom.gif';
clearInterval(MyMar);
}
function gotop(){
$('showArea').scrollTop-=spec;
}
function gobottom(){
$('showArea').scrollTop+=spec;
} 展开
document.getElementsByClassName=function(cl){
var retnode=[];
var myclass=new RegExp('\\b'+cl+'\\b');
var elem=this.getElementsByTagName('*');
for(var i=0;i<elem.length;i++){
var classes=elem[i].className;
if(myclass.test(classes))
retnode.push(elem[i]);
}
return retnode;
}
var MyMar;
var speed=1;
var spec=1;
var ipath='images/';
var thumbs=document.getElementsByClassName('thumb_img');
for(var i=0;i<thumbs.length;i++){
thumbs[i].onmouseover=function(){
$('main_img').src=this.rel;
$('main_img').link=this.link;
};
thumbs[i].onclick=function(){
location=this.link;
}
}
$('main_img').onclick=function(){
location=this.link;
}
$('gotop').onmouseover=function(){
this.src=ipath+'gotop2.gif';
MyMar=setInterval(gotop,speed);
}
$('gotop').onmouseout=function(){
this.src=ipath+'gotop.gif';
clearInterval(MyMar);
}
$('gobottom').onmouseover=function(){
this.src=ipath+'gobottom2.gif';
MyMar=setInterval(gobottom,speed);
}
$('gobottom').onmouseout=function(){
this.src=ipath+'gobottom.gif';
clearInterval(MyMar);
}
function gotop(){
$('showArea').scrollTop-=spec;
}
function gobottom(){
$('showArea').scrollTop+=spec;
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询