图片滚动的问题
一个奇怪的问题,如果该图片滚动的js代码不在table中,那么滚动正常,如果在table中,那么就会自动停止滚动,请问该如何解决,该图片滚动js代码如下:<!--
var ScrollObj = function(scrollBodyId,scrollBoxId,showHeight,showWidth,lineHeight,stopTime,speed) {
this.obj = document.getElementById(scrollBodyId);
this.box = document.getElementById(scrollBoxId);
this.style = this.obj.style;
this.defaultHeight = this.obj.offsetHeight;
this.obj.innerHTML += this.obj.innerHTML;
this.obj.style.position = \"relative\";
this.box.style.height = showHeight;
this.box.style.width = showWidth;
this.box.style.overflow = \"hidden\";
this.scrollUp = doScrollUp;
this.stopScroll = false;
this.curLineHeight = 0;
this.lineHeight = lineHeight;
this.curStopTime = 0;
this.stopTime = stopTime;
this.speed = speed;
this.style.top = lineHeight;
this.object = scrollBodyId + \"Object\";
eval(this.object + \"=this\");
setInterval(this.object+\".scrollUp()\",speed);
this.obj.onmouseover=new Function(this.object+\".stopScroll=true\");
this.obj.onmouseout=new Function(this.object+\".stopScroll=false\");
}
function doScrollUp(){
if( this.stopScroll == true )
return;
this.curLineHeight += 1;
if( this.curLineHeight >= this.lineHeight ){
this.curStopTime += 1;
if( this.curStopTime >= this.stopTime ){
this.curLineHeight = 0;
this.curStopTime = 0;
}
}
else{
this.style.top = parseInt(this.style.top) - 1;
if( -parseInt(this.style.top) >= this.defaultHeight ){
this.style.top = 0;
}
}
}
document.write(\'<div id=\"scroollBox487\" >\');
document.write(\'<div id=\"scroollBody487\">\');
document.write(\'<div><a href=\"http://www.souho.net\" target=\"_blank\"><img src=\"/images/1.gif\"></a></div>\');
document.write(\'<div><a href=\"http://www.souho.net\" target=\"_blank\"><img src=\"/images/2.gif\"></a></div>\');
document.write(\'<div><a href=\"http://www.souho.net\" target=\"_blank\"><img src=\"/images/3.gif\"></a></div>\');
document.write(\'</div></div>\');
var sample487 = new ScrollObj(\"scroollBody487\",\"scroollBox487\",500,200,20,50,50); 已经用了<script language="javascript" src="/js/1.js"></script>这种方法调用 8 8 8 我也搞不懂额.`.... 8 1 2 百迈呢,快来快来!!!
页:
[1]