一个不错的幻灯片效果

时间:2022-11-24 08:27:54
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> 图片播放器 -无忧WEB技术网</TITLE>
<metahttp-equiv="pragma"content="no-cache">
<metahttp-equiv="cache-control"content="no-cache,must-revalidate">
<metahttp-equiv="expires"content="wed,26feb199708:21:57gmt">
<style>
body{font-size:12px;margin:0px;height:100%;}
#rotatorPlayer{text-align:center;width:100%}
#seconddiv{position:absolute;z-index:1;top:0;left:702;text-align:left;border:1px #333333 solid;height:100%;padding:6px}
img{border:0px}
#menu{position:absolute;z-index:1;top:40;left:710;width:200px;text-align:left}
#second{width:116px;height:20px;border:1px #000000 solid}
#button{width:60px;height:20px;border:1px #000000 solid;cursor:hand}
</style>
</HEAD>
<BODY scroll=no>
<div id=seconddiv><select name="second" id=second>
<option value=1>1 秒</option>
<option value=2>2 秒</option>
<option value=3>3 秒</option>
<option value=4>4 秒</option>
<option value=5>5 秒</option>
<option value=6>6 秒</option>
<option value=7>7 秒</option>
<option value=8>8 秒</option>
<option value=9>9 秒</option>
<option value=10>10 秒</option>
<option value=15>15 秒</option>
<option value=20>20 秒</option>
<option value=30>30 秒</option>
<option value=40>40 秒</option>
<option value=50>50 秒</option>
<option value=60>60 秒</option>
<option value=100>100 秒</option>
<option value=200>200 秒</option>
<option value=500>500 秒</option>
</select>&nbsp;&nbsp;<button id=button onclick="adRotator.set(getRef('second').value)">播放</button></div>
<div style="width:700;height:100%">
<div id=AdRotator></div>
<SCRIPT LANGUAGE="JavaScript">
<!--
function pimsize(imgname,widths,heights){
var w;
var h;
//window.alert(picimg.width);
//window.alert(picimg.height);
w=imgname.width;
h=imgname.height;
if(imgname.width>widths){
do
w=w-1;
while (w&gt;widths) ;
s=w/imgname.width;
//window.alert(s);
imgname.width=w;
imgname.height=h*s;
h=imgname.height
}
//window.alert(imgname.height);
//window.alert(heights);
if(imgname.height&gt;heights){
do
h=h-1;
while (h&gt;heights) ;
s=h/imgname.height;
//window.alert(s);
imgname.width=w*s;
imgname.height=heights;
}
}
 

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 = "";
 // configration.
 // @ image width
 // @ image height
 // @ rotator speed
 // @ filter type
 this._w = 450;
 this._h = 450;
 this._s = 4;
 this._x = 23;
 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);
   //getRef("AdRotator").innerHTML="complete";
   adRotator.play();
  }
  else
  {
   _c++;
   getRef(_o).innerHTML="total images " + _p.length + ", loading picture " + _c + ' ' + _i.readyState + "...";
   _timeout=window.setTimeout(adRotator.load,10)
  }
 }
 else
 {
  getRef(_o).innerHTML="total images " + _p.length + ", loading picture " + _c + ' ' + _i.readyState + "...";
  _timeout=window.setTimeout(adRotator.load,10)
 }
}};
adRotator.play=function() { with (adRotator)
{
 if( _f )
 {
 _html = "";
 _html += '<table style="border:1px solid #333333;width:100%;height:100%" align=center><tr><td style="font-size:9pt;font-family:tahoma;font-weight:bold;text-align:Center">'
 _html += '<div id="rotatorPlayer"'
   + ' style="width:' + _w + ''
   + ';height:"' + _h + '"'
   + '>'
 _html += '<a href="' + ( _l[_c] ? _l[_c] : "javascript:void(0);" ) + '">';
 _html += '<img name=img id="rotatorPic" src="' + _p[_c] + '"'
   //+ ' width="' + _w + '"'
   //+ ' height="' + _h + '"'
   + 'onload="pimsize(img,700,550)"'
   + (_t[_c]?' title="' + _t[_c] + '"':'')
   + ' style="border:1px solid blue;FILTER:revealTrans(transition=' + _x + ',duration=1);"'
   + ' >';
 _html += (_t[_c]?('<div align="center">' + (_c+1) + '. ' + _t[_c] + '</div>'):'<p></p>');
 _html += '</a>';
 _html += "</div>";
 _html += '<div id=menu>';
 for(var i=0; i<_p.length; i++)
  _html += '&lt;span'
     + ' style="border:1px solid #333333;padding:1px 5px 1px 5px;height:20px;text-align:center;cursor:'
     + (_c==i ? ('default;background-color:red;"') : 'hand;" onclick="adRotator.select(' + i + ')"')
     + '>'
     + (i&gt;8?(i+1):('0'+(i+1)))+ '</span> ';
 _html += "</div></td></tr></table>";
 getRef(_o).innerHTML = _html;
 getRef("rotatorPic").filters[0].Apply();
 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","#")
adRotator.add(" http://img1.qq.com/ent/20060218/3215111.jpg","aa","#")
adRotator.add(" http://img1.qq.com/ent/20060218/3215112.jpg","aa","#")
adRotator.add(" http://img1.qq.com/ent/20060218/3215113.jpg","aa","#")
adRotator.add(" http://img1.qq.com/ent/20060218/3215114.jpg","aa","#")
adRotator.add(" http://www.mydeskcity.com/theme/WorldMap/400/WorldMap08.jpg","aa","#")
adRotator.add(" http://www.mydeskcity.com/theme/WorldMap/400/WorldMap08.jpg","aa","#")
adRotator.add(" http://img1.qq.com/ent/20060218/3215112.jpg","aa","#")
adRotator.add(" http://img1.qq.com/ent/20060218/3215113.jpg","aa","#")
adRotator.add(" http://img1.qq.com/ent/20060218/3215114.jpg","aa","#")
adRotator.add(" http://img1.qq.com/ent/20060218/3215110.jpg","aa","#")
adRotator.add(" http://img1.qq.com/ent/20060218/3215111.jpg","aa","#")
adRotator.add(" http://img1.qq.com/ent/20060218/3215112.jpg","aa","#")
adRotator.add(" http://img1.qq.com/ent/20060218/3215113.jpg","aa","#")
adRotator.add(" http://img1.qq.com/ent/20060218/3215114.jpg","aa","#")
adRotator.add(" http://img1.qq.com/ent/20060218/3215110.jpg","aa","#")
adRotator.add(" http://img1.qq.com/ent/20060218/3215111.jpg","aa","#")
adRotator.add(" http://img1.qq.com/ent/20060218/3215112.jpg","aa","#")
adRotator.add(" http://img1.qq.com/ent/20060218/3215113.jpg","aa","#")
adRotator.add(" http://img1.qq.com/ent/20060218/3215114.jpg","aa","#")
adRotator.add(" http://img1.qq.com/ent/20060218/3215110.jpg","aa","#")
adRotator.add(" http://img1.qq.com/ent/20060218/3215111.jpg","aa","#")
adRotator.add(" http://img1.qq.com/ent/20060218/3215112.jpg","aa","#")
adRotator.add(" http://img1.qq.com/ent/20060218/3215113.jpg","aa","#")
adRotator.add(" http://img1.qq.com/ent/20060218/3215114.jpg","aa","#")
adRotator.add(" http://img1.qq.com/ent/20060218/3215110.jpg","aa","#")
adRotator.add(" http://img1.qq.com/ent/20060218/3215111.jpg","aa","#")
adRotator.add(" http://img1.qq.com/ent/20060218/3215112.jpg","aa","#")
adRotator.add(" http://img1.qq.com/ent/20060218/3215113.jpg","aa","#")
adRotator.add(" http://img1.qq.com/ent/20060218/3215114.jpg","aa","#")
adRotator.add(" http://img1.qq.com/ent/20060218/3215110.jpg","aa","#")
adRotator.add(" http://img1.qq.com/ent/20060218/3215111.jpg","aa","#")
adRotator.add(" http://img1.qq.com/ent/20060218/3215112.jpg","aa","#")
adRotator.add(" http://img1.qq.com/ent/20060218/3215113.jpg","aa","#")
adRotator.add(" http://img1.qq.com/ent/20060218/3215114.jpg","aa","#")
adRotator.add(" http://img1.qq.com/ent/20060218/3215110.jpg","aa","#")
adRotator.add(" http://img1.qq.com/ent/20060218/3215111.jpg","aa","#")
adRotator.add(" http://img1.qq.com/ent/20060218/3215112.jpg","aa","#")
adRotator.add(" http://img1.qq.com/ent/20060218/3215113.jpg","aa","#")
adRotator.add(" http://img1.qq.com/ent/20060218/3215114.jpg","aa","#")
adRotator.add(" http://img1.qq.com/ent/20060218/3215110.jpg","aa","#")
adRotator.add(" http://img1.qq.com/ent/20060218/3215111.jpg","aa","#")
adRotator.add(" http://img1.qq.com/ent/20060218/3215112.jpg","aa","#")
adRotator.add(" http://img1.qq.com/ent/20060218/3215113.jpg","aa","#")
adRotator.add(" http://img1.qq.com/ent/20060218/3215114.jpg","aa","#")
adRotator.play();
//--&gt;
</SCRIPT>
</BODY>
</HTML>