为什么我的JS代码在火狐中不能正常使用?

来源:百度知道 编辑:UC知道 时间:2024/05/17 01:37:29
请高手帮我看一下下面的代码,在其它浏览器中都没有问题,但在火狐中连显示都没有,拜托告诉我如何能兼容,我把自己不多的分数全给您!谢谢!

代码:
<script>
marqueesHeight=200;
stopscroll=false;
with(icefable1){
style.width=0;
style.height=marqueesHeight;
style.overflowX="visible";
style.overflowY="hidden";
noWrap=true;
onmouseover=new Function("stopscroll=true");
onmouseout=new Function("stopscroll=false");
}
preTop=0; currentTop=marqueesHeight; stoptime=0;
icefable1.innerHTML+=icefable1.innerHTML;

function init_srolltext(){
icefable1.scrollTop=0;
setInterval("scrollUp()",1);
}init_srolltext();
function scrollUp(){
if(stopscroll==true) return;
currentTop+=1;
if(currentTop==marqueesHeight+1)
{
stoptime+=1;
currentTop-=1;
if(stoptime==1000)
{
currentTop=0;
stoptime=0;
}

本来蛮想帮你弄的.不过,你只出了js代码.建议你还是贴出全部代码.或许有人会过来回答

var marqueesHeight=200;
stopscroll=false;
//要使用完全写法,不能使用简写,以下同
var icefable1=document.getElementById("icefable1");
with(icefable1){
style.width=0;
style.height=marqueesHeight;
style.overflowX="visible";
style.overflowY="hidden";
noWrap=true;
onmouseover=new Function("stopscroll=true");
onmouseout=new Function("stopscroll=false");
}
var preTop=0;
var currentTop=marqueesHeight;
var stoptime=0;
//这句也要用完全写法,不过已经在上面定义了icefable1,这里可以直接用了
icefable1.innerHTML+=icefable1.innerHTML;

function init_srolltext(){
icefable1.scrollTop=0;
setInterval("scrollUp()",1);
}init_srolltext();
function scrollUp(){
if(stopscroll==true) return;
currentTop+=1;
if(currentTop==marqueesHeight+1)
{
stoptime+=1;
currentTop-=1;
if(stopt