<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Tra itional//E quot gt;
<HTML>
<HEAD>
<TITLE>JS实现图片幻灯片效果</TITLE>
<META NAME="Generator" CONTENT="EditPlu quot gt;
<META NAME="Author" CONTENT=" quot gt;
<META NAME="Keyword quot; CONTENT=" quot gt;
<META NAME="Descriptio quot; CONTENT=" quot gt;
</HEAD>
< ODY>
<div align="center" gt lt;div id=AdRotator> lt;/div> lt;i ut id=" econd" gt lt utton onclick="adRotator.set(getRef('second').value)" gt et time</butto gt lt;/div>
< CRIPT LANGUAGE="JavaScript" gt;
<!--
function adRotator() {};
adRotator.initialize=function(o)
{
// script by blueDestiny
this._t = new Array();
this._l = new Array();
this._p = new Array();
this._i = new Image();
this._c = 0;
this._f = false;
this._o = o;
this._timeout = null;
this._html = " quot
// configration.
// @ image width
// @ image height
// @ rotator eed
// @ filter type
this._w = 450;
this._h = 450;
this._s = 4;
this._x = 23;
return thi
};
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);
//getRef("AdRotator").i erHTML="complete"
adRotator.play();
}
else
{
_c++;
getRef(_o).i erHTML="total images " + _p.length + ", loading picture " + _c + ' ' + _i.readyState + "..."
_timeout=window.setTimeout(adRotator.load,10)
}
}
else
{
getRef(_o).i erHTML="total images " + _p.length + ", loading picture " + _c + ' ' + _i.readyState + "..."
_timeout=window.setTimeout(adRotator.load,10)
}
}};
adRotator.play=function() { with (adRotator)
{
if( _f )
{
_html = " quot
_html += '<table style=" order:1px solid #333333 quot gt lt;tr> lt;td style="font-size:9pt;font-family:tahoma;font-weight:bold quot gt;'
_html += '<div id="rotatorPlayer"'
+ ' style="width:' + _w + ''
+ ';height:"' + _h + '"'
+ '>'
_html += '<a href="' + ( _l[_c] ? _l[_c] : "javascript:void(0) quot; ) + '" gt;';
_html += '<img id="rotatorPic" src="' + _p[_c] + '"'
+ ' width="' + _w + '"'
+ ' height="' + _h + '"'
+ (_t[_c]?' title="' + _t[_c] + '"':'')
+ ' style=" order:1px solid blue;FILTER:revealTra (tra ition=' + _x + ',duration=1) quot;'
+ ' >';
_html += (_t[_c]?('<div align="center" gt;' + (_c+1) + '. ' + _t[_c] + '</div>'):'< gt lt;/ gt;');
_html += '</a>';
_html += " lt;/div> quot
_html += '<div align="right" gt;';
for(var i=0; i<_p.length; i++)
_html += '< an'
+ ' style=" order:1px solid #333333 adding:1px 5px 1px 5px;height:20px;text-align:center;cursor:'
+ (_c==i ? ('default ackground-color:red quot;') : 'hand quot; onclick="adRotator.select(' + i + ')"')
+ '>'
+ (i>8?(i+1):('0'+(i+1)))+ '</ a gt; ';
_html += " lt;/div> lt;/td> lt;/tr> lt;/table> quot
getRef(_o).i erHTML = _html;
getRef("rotatorPic").filters[0].A ly();
getRef("rotatorPic").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);
}};
adRotator.select=function(i) { with (this)
{
window.clearTimeout(_timeout);
_c=i;
adRotator.play();
}};
adRotator.set=function(second) { with (this)
{
window.clearTimeout(_timeout);
if((/\d+/).test(second)==true)
{
_s=second;
adRotator.play();
}
else
{
alert("must be digit!")
adRotator.play();
}
}};
function getRef(id)
{
return (document.all?document.all(id):document.getElementById(id));
}
adRotator.initialize("AdRotator");
adRotator.add("http://img1.qq.com/ent/20060218/3215110.jpg","aa","http://www.blueidea.com")
adRotator.add("http://img1.qq.com/ent/20060218/3215111.jpg")
adRotator.add("http://img1.qq.com/ent/20060218/3215112.jpg")
adRotator.add("http://img1.qq.com/ent/20060218/3215113.jpg")
adRotator.add("http://img1.qq.com/ent/20060218/3215114.jpg")
adRotator.play();
//-->
</SCRIPT>
</BODY>
</HTML>
寻她模板站 ┃ 精美源于细节,细节造就成功。