日期:2014-05-16  浏览次数:20344 次

帮忙看看这段幻灯片程序为什么有时不行,有时就可以。
<SCRIPT   LANGUAGE= "JavaScript ">
function   adRotator()   {};
adRotator.initialize=function(o)
{
this._t   =   new   Array(); //图片说明
//id,影片名,人气,观看次数,主演,分类,出产地,集数,推荐级别,开放级别,加入时间
this._l   =   new   Array(); //图片超连接
//film_view.asp?id=id
this._p   =   new   Array(); //图片路径
//../film_pic/大图
this._i   =   new   Image(); //图片容器
this._c   =   0; //图片总数
this._f   =   false; //加载完毕标志
this._o   =   o; //保存层名
this._timeout   =   null; //
this._html   =   " "; //层的HTML代码
this._w   =   190; //图片宽度
this._h   =   260; //图片高度
this._s   =   2; //间隔时间
this._x   =   20; //幻灯片样式
this._y   =   1; //幻灯片时间
return   this;
};
adRotator.add=function(p,t,l)
{   with   (this)
{
_p.push(p);
_t.push(t);
_l.push(l);
}
};
adRotator.load=function()
{   with   (adRotator)
{
if(   _i.readyState== 'complete '   )
{
if(_p.length-1==_c)
{
_f   =   true;
_c   =   0;
window.clearTimeout(_timeout);
adRotator.play();
}
else
{
_c++;
_timeout=window.setTimeout(adRotator.load,100)
}
}
else
{
_timeout=window.setTimeout(adRotator.load,100)
}
}
};
adRotator.play=function()
{   with   (adRotator)
{
if(   _f   )
{
getHtml();
//alert(_html);
getRef(_o).innerHTML   =   _html;
getRef( "film_pic ").filters[0].Apply();
getRef( "film_pic ").filters[0].Play();
next();
}
else
{
_i.src   =   _p[_c];
adRotator.load();
}
}
};
adRotator.next=function()
{   with   (this)
{
(_p.length-1==_c)   ?   _c=0   :   _c++;
_timeout=window.setTimeout(adRotator.play,_s*1000);
}
};

------解决方案--------------------
帮顶
------解决方案--------------------
你这个好说,只要改一个地方就可以了!
this._f = false;//加载完毕标志
改为
this._f = true;//加载完毕标志
就一切OK
------解决方案--------------------
_timeout=window.setTimeout(adRotator.play,0);

加个延时试试,_timeout=window.setTimeout(adRotator.play,1000);

我这边倒是每次都行的,
------解决方案--------------------
我这边怎么是好的啊