您的位置信息之舟电 脑硬件栏目首页网页制作HTML 收藏本页

→ 一个做网站比较流行的图片幻灯片网页特效

www.kepusoft.com 信息之舟电脑软件应用栏目

    信息之舟电脑软件应用栏目编者按:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE> New Document </TITLE>
    <META NAME="Generator" CONTENT="EditPlus">
    <META NAME="Author" CONTENT="">
    <META NAME="Keywords" CONTENT="">
    <META NAME="Description" CONTENT="">
    </HEAD>

    <BODY>
    <div align="center"><div id=AdRotator></div><input id="second"><button onclick="adRotator.set(getRef('second').value)">set time</button></div>
    <SCRIPT LANGUAGE="JavaScript">
    <!--
    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;"><tr><td style="font-size:9pt;font-family:tahoma;font-weight:bold;">'
     _html += '<div id="rotatorPlayer"'
       + ' style="width:' + _w + ''
       + ';height:"' + _h + '"'
       + '>'
     _html += '<a href="' + ( _l[_c] ? _l[_c] : "javascript:void(0);" ) + '">';
     _html += '<img id="rotatorPic" src="' + _p[_c] + '"'
       + ' width="' + _w + '"'
       + ' height="' + _h + '"'
       + (_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 align="right">';

     for(var i=0; i<_p.length; i++)
      _html += '<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>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://www.webjx.com/img/200406301.jpg","欢迎","http://www.kepusoft.com")
    adRotator.add("http://www.webjx.com/img/200406302.jpg")
    adRotator.add("http://www.webjx.com/img/200406303.jpg")
    adRotator.add("http://www.webjx.com/img/200406304.jpg")
    adRotator.add("http://www.webjx.com/img/200406305.jpg")

    adRotator.play();
    //-->
    </SCRIPT>
    </BODY>
    </HTML>

www.kepusoft.com 信息之舟电脑之家收集整理推荐文章

相关文章:·textarea多行多列输入元素:窗体中的基本元素(实施对Textarea中的元素进行控制)
·怎么样通过加载JS到html或Asp中来实现页面自动更新呢?
·图片特殊效果HTML源代码汇集整理(美化你的网页)
·ASP和html中用java script控制图片显示的大小(等比例缩放)
·Button按钮 功能:实施对Button按钮的控制 checkbox检查框 功能:实施对一个具有复选框中元素的控制
·radio无线按钮 功能:实施对一个具单选功能的无线按钮控制 hidden:隐藏 功能:实施对一个具有不显示文字并能输入字符的区域元素的控制
·Select选择元素:实施对滚动选择元素的控制_窗体中的基本元素
·一个做网站比较流行的图片幻灯片网页特效
·基本HTML代码大集合(整理中...)
·使用DIV排版的经验
→ HTML栏目列表:

DreamWeaver
FrontPage
FireWorks
Flash
HTML
CSS&其它

→ 赞助商链接:
→ 热门文章排行榜:
·textarea多行多列输入元素:窗体中的基本元素(实施对Textarea中的元素进行控制)
·怎么样通过加载JS到html或Asp中来实现页面自动更新呢?
·图片特殊效果HTML源代码汇集整理(美化你的网页)
·ASP和html中用java script控制图片显示的大小(等比例缩放)
·Button按钮 功能:实施对Button按钮的控制 checkbox检查框 功能:实施对一个具有复选框中元素的控制
·radio无线按钮 功能:实施对一个具单选功能的无线按钮控制 hidden:隐藏 功能:实施对一个具有不显示文字并能输入字符的区域元素的控制
·Select选择元素:实施对滚动选择元素的控制_窗体中的基本元素
·一个做网站比较流行的图片幻灯片网页特效
·基本HTML代码大集合(整理中...)
·使用DIV排版的经验