在IE能用 而火狐和谷歌不能用(含泪求助)
时间:2011-08-31
来源:互联网
<script>
function Marquee(){
this.ID=document.getElementById(arguments[0]);
this.Direction=arguments[1];
this.Step=arguments[2];
this.Width=arguments[3];
this.Height=arguments[4];
this.Timer=arguments[5];
this.WaitTime=arguments[6];
this.StopTime=arguments[7];
if(arguments[8]){this.ScrollStep=arguments[8];}else{this.ScrollStep=this.Direction>1?this.Width:this.Height;}
this.CTL=this.StartID=this.Stop=this.MouseOver=0;
this.ID.style.overflow=this.ID.style.overflow="hidden";
this.ID.noWrap=true;
this.ID.style.width=this.Width;
this.ID.style.height=this.Height;
this.ClientScroll=this.Direction>1?this.ID.scrollWidth:this.ID.scrollHeight;
this.ID.innerHTML+=this.ID.innerHTML;
this.Start(this,this.Timer,this.WaitTime,this.StopTime);
}
Marquee.prototype.Start=function(msobj,timer,waittime,stoptime){
msobj.StartID=function(){msobj.Scroll();}
msobj.Continue=function(){
if(msobj.MouseOver==1){setTimeout(msobj.Continue,waittime);}
else{clearInterval(msobj.TimerID); msobj.CTL=msobj.Stop=0; msobj.TimerID=setInterval(msobj.StartID,timer);}
}
msobj.Pause=function(){msobj.Stop=1; clearInterval(msobj.TimerID); setTimeout(msobj.Continue,waittime);}
msobj.Begin=function(){
msobj.TimerID=setInterval(msobj.StartID,timer);
msobj.ID.onmouseover=function(){msobj.MouseOver=1; clearInterval(msobj.TimerID);}
msobj.ID.onmouseout=function(){msobj.MouseOver=0; if(msobj.Stop==0){clearInterval(msobj.TimerID); msobj.TimerID=setInterval(msobj.StartID,timer);}}
}
setTimeout(msobj.Begin,stoptime);
}
Marquee.prototype.Scroll=function(){
switch(this.Direction){
case 0:
this.CTL+=this.Step;
if(this.CTL>=this.ScrollStep&&this.WaitTime>0){this.ID.scrollTop+=this.ScrollStep+this.Step-this.CTL; this.Pause(); return;}
else{if(this.ID.scrollTop>=this.ClientScroll) this.ID.scrollTop-=this.ClientScroll; this.ID.scrollTop+=this.Step;}
break;
case 1:
this.CTL+=this.Step;
if(this.CTL>=this.ScrollStep&&this.WaitTime>0){this.ID.scrollTop-=this.ScrollStep+this.Step-this.CTL; this.Pause(); return;}
else{if(this.ID.scrollTop<=0) this.ID.scrollTop+=this.ClientScroll; this.ID.scrollTop-=this.Step;}
break;
case 2:
this.CTL+=this.Step;
if(this.CTL>=this.ScrollStep&&this.WaitTime>0){this.ID.scrollLeft+=this.ScrollStep+this.Step-this.CTL; this.Pause(); return;}
else{if(this.ID.scrollLeft>=this.ClientScroll) this.ID.scrollLeft-=this.ClientScroll; this.ID.scrollLeft+=this.Step;}
break;
case 3:
this.CTL+=this.Step;
if(this.CTL>=this.ScrollStep&&this.WaitTime>0){this.ID.scrollLeft-=this.ScrollStep+this.Step-this.CTL; this.Pause(); return;}
else{if(this.ID.scrollLeft<=0) this.ID.scrollLeft+=this.ClientScroll; this.ID.scrollLeft-=this.Step;}
break;
}
}
</script>
<div id="marqueediv8" style="width:474px; height:91px; background:#333; margin-top:5px; float:left; overflow:hidden;" ><img src="images/footer1.jpg" border="0"/><img src="images/footer2.jpg" border="0"/><img src="images/footer3.jpg" border="0"/><img src="images/footer4.jpg" border="0"/><img src="images/footer5.jpg" border="0"/><img src="images/footer6.jpg" border="0"/><img src="images/footer7.jpg" border="0"/><img src="images/footer8.jpg" border="0"/><img src="images/footer9.jpg" border="0"/><img src="images/footer10.jpg" border="0"/><img src="images/footer11.jpg" border="0"/><img src="images/footer12.jpg"border="0" /></div>
<script>
window.onload=function(){
new Marquee(
"marqueediv8", //容器ID<br />
2, //向上滚动(0向上 1向下 2向左 3向右)<br />
20, //滚动的步长<br />
474, //容器可视宽度<br />
91, //容器可视高度<br />
40, //定时器 数值越小,滚动的速度越快(1000=1秒,建议不小于20)<br />
1000, //间歇停顿时间(0为不停顿,1000=1秒)<br />
700, //开始时的等待时间(0为不等待,1000=1秒)<br />
474//间歇滚动间距(可选)<br />
);
};
</script>
function Marquee(){
this.ID=document.getElementById(arguments[0]);
this.Direction=arguments[1];
this.Step=arguments[2];
this.Width=arguments[3];
this.Height=arguments[4];
this.Timer=arguments[5];
this.WaitTime=arguments[6];
this.StopTime=arguments[7];
if(arguments[8]){this.ScrollStep=arguments[8];}else{this.ScrollStep=this.Direction>1?this.Width:this.Height;}
this.CTL=this.StartID=this.Stop=this.MouseOver=0;
this.ID.style.overflow=this.ID.style.overflow="hidden";
this.ID.noWrap=true;
this.ID.style.width=this.Width;
this.ID.style.height=this.Height;
this.ClientScroll=this.Direction>1?this.ID.scrollWidth:this.ID.scrollHeight;
this.ID.innerHTML+=this.ID.innerHTML;
this.Start(this,this.Timer,this.WaitTime,this.StopTime);
}
Marquee.prototype.Start=function(msobj,timer,waittime,stoptime){
msobj.StartID=function(){msobj.Scroll();}
msobj.Continue=function(){
if(msobj.MouseOver==1){setTimeout(msobj.Continue,waittime);}
else{clearInterval(msobj.TimerID); msobj.CTL=msobj.Stop=0; msobj.TimerID=setInterval(msobj.StartID,timer);}
}
msobj.Pause=function(){msobj.Stop=1; clearInterval(msobj.TimerID); setTimeout(msobj.Continue,waittime);}
msobj.Begin=function(){
msobj.TimerID=setInterval(msobj.StartID,timer);
msobj.ID.onmouseover=function(){msobj.MouseOver=1; clearInterval(msobj.TimerID);}
msobj.ID.onmouseout=function(){msobj.MouseOver=0; if(msobj.Stop==0){clearInterval(msobj.TimerID); msobj.TimerID=setInterval(msobj.StartID,timer);}}
}
setTimeout(msobj.Begin,stoptime);
}
Marquee.prototype.Scroll=function(){
switch(this.Direction){
case 0:
this.CTL+=this.Step;
if(this.CTL>=this.ScrollStep&&this.WaitTime>0){this.ID.scrollTop+=this.ScrollStep+this.Step-this.CTL; this.Pause(); return;}
else{if(this.ID.scrollTop>=this.ClientScroll) this.ID.scrollTop-=this.ClientScroll; this.ID.scrollTop+=this.Step;}
break;
case 1:
this.CTL+=this.Step;
if(this.CTL>=this.ScrollStep&&this.WaitTime>0){this.ID.scrollTop-=this.ScrollStep+this.Step-this.CTL; this.Pause(); return;}
else{if(this.ID.scrollTop<=0) this.ID.scrollTop+=this.ClientScroll; this.ID.scrollTop-=this.Step;}
break;
case 2:
this.CTL+=this.Step;
if(this.CTL>=this.ScrollStep&&this.WaitTime>0){this.ID.scrollLeft+=this.ScrollStep+this.Step-this.CTL; this.Pause(); return;}
else{if(this.ID.scrollLeft>=this.ClientScroll) this.ID.scrollLeft-=this.ClientScroll; this.ID.scrollLeft+=this.Step;}
break;
case 3:
this.CTL+=this.Step;
if(this.CTL>=this.ScrollStep&&this.WaitTime>0){this.ID.scrollLeft-=this.ScrollStep+this.Step-this.CTL; this.Pause(); return;}
else{if(this.ID.scrollLeft<=0) this.ID.scrollLeft+=this.ClientScroll; this.ID.scrollLeft-=this.Step;}
break;
}
}
</script>
<div id="marqueediv8" style="width:474px; height:91px; background:#333; margin-top:5px; float:left; overflow:hidden;" ><img src="images/footer1.jpg" border="0"/><img src="images/footer2.jpg" border="0"/><img src="images/footer3.jpg" border="0"/><img src="images/footer4.jpg" border="0"/><img src="images/footer5.jpg" border="0"/><img src="images/footer6.jpg" border="0"/><img src="images/footer7.jpg" border="0"/><img src="images/footer8.jpg" border="0"/><img src="images/footer9.jpg" border="0"/><img src="images/footer10.jpg" border="0"/><img src="images/footer11.jpg" border="0"/><img src="images/footer12.jpg"border="0" /></div>
<script>
window.onload=function(){
new Marquee(
"marqueediv8", //容器ID<br />
2, //向上滚动(0向上 1向下 2向左 3向右)<br />
20, //滚动的步长<br />
474, //容器可视宽度<br />
91, //容器可视高度<br />
40, //定时器 数值越小,滚动的速度越快(1000=1秒,建议不小于20)<br />
1000, //间歇停顿时间(0为不停顿,1000=1秒)<br />
700, //开始时的等待时间(0为不等待,1000=1秒)<br />
474//间歇滚动间距(可选)<br />
);
};
</script>
作者: ddnirvana 发布时间: 2011-08-31
没办法,只能自己调试了。
作者: softroad 发布时间: 2011-08-31
IE有些属性和火狐不一样的
作者: yxk19890903 发布时间: 2011-08-31
这个看你们公司的主要支持的浏览器吧。不可能全部兼容的
作者: yangting_lisa 发布时间: 2011-08-31
这种问题是经常存在的,我们公司就规定了让用户只能用IE,这个东西需要慢慢学啊,楼主。
作者: dzr1990 发布时间: 2011-08-31
是不是W3C规范的问题啊 ?? 呵呵 我胡说的 我们最近在学W3C
作者: huzhenfeng1111 发布时间: 2011-08-31
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28