1. 论坛系统升级为Xenforo,欢迎大家测试!
    排除公告

盛大《跳跳堂》网站首页轮换广告代码

本帖由 不学无术2006-04-18 发布。版面名称:前端开发

  1. 不学无术

    不学无术 Ulysses 的元神

    注册:
    2005-08-31
    帖子:
    16,714
    赞:
    39
    效果:http://ttt.sdo.com/web1.0/banner.htm

    备份:

    HTML:
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>Untitled Document</title>
    <style type="text/css">
    <!--
    body {
    	margin-left: 0px;
    	margin-top: 0px;
    	margin-right: 0px;
    	margin-bottom: 0px;
    }
    -->
    </style></head>
    
    <body topmargin="3">
    <table width="500" height="3" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td><img src="images/ad/blank.gif" width="1" height="1"></td>
      </tr>
    </table>
    
    <!--rotate 硅呈 抛捞喉 矫累-->		
    <script>
    var fadeimages = new Array;
    var linkarr = new Array;
    var numimg = new Array;
    	fadeimages[0] = 'images/ad/ad060418.jpg';
    	linkarr[0] = 'http://ttt.sdo.com/web1.0/News.asp?a=1&CategoryID=1&ID=136';
    	numimg[0] = 'images/01_02.gif';
    
    	fadeimages[1] = 'images/ad/ad05.gif';
    	linkarr[1] = 'http://ttt.sdo.com/project/test/event4.asp';
    	numimg[1] = 'images/02_02.gif';
    	
    	fadeimages[2] = 'images/ad/ad01.gif';
    	linkarr[2] = 'http://ttt.sdo.com/project/media/';
    	numimg[2] = 'images/03_02.gif';
    	
    	fadeimages[3] = 'images/ad/ad02.gif';
    	linkarr[3] = 'http://ttt.sdo.com';
    	numimg[3] = 'images/04_02.gif';
    	
    	fadeimages[4] = 'images/ad/ad03.gif';
    	linkarr[4] = 'http://ttt.sdo.com';
    	numimg[4] = 'images/05_02.gif';
    
    	fadeimages[5] = 'images/ad/ad04.gif';
    	linkarr[5] = 'http://ttt.sdo.com';
    	numimg[5] = 'images/06_02.gif';
    	
    var cliImg = '';
    var cliImgSrc = '';
    var n = Math.round(Math.random() * 10);
    var interval = 7000;
    var setTimeId = '';
    
    function rotateStop()
    {
    	clearTimeout(setTimeId);
    }
    
    function rotateStart()
    {
    	rotate();
    }
    
    function chki(ci, no)
    {
    	var pImg = document.all.RollImg;
    	var pUrl = document.all.RollUrl;
    
    	if(cliImg == '') {
    		cliImg = ci;
    		cliImgSrc = ci.src;
    		ci.src = numimg[no];
    		n=no;
    		pImg.src = fadeimages[no];
    		pUrl.href = linkarr[no];		
    	} else if(cliImg != ci) {
    		cliImg.src = cliImgSrc;
    		cliImg = ci;
    		cliImgSrc = ci.src;
    		ci.src = numimg[no];
    		n=no;
    		pImg.src = fadeimages[no];
    		pUrl.href = linkarr[no];		
    	}
    }
    
    function rotate()
    {
    	n = (n >= 3) ? 0 : n+1;
    	setimgurl();
    	setTimeId=setTimeout("rotate()",interval);
    }
    
    function setimgurl()
    {
    	var ci = eval('document.all.num_img'+n);
    
    	document.all.RollImg.filters.blendTrans.apply();
    	document.all.RollUrl.href=linkarr[n];
    	document.all.RollImg.src=fadeimages[n];
    	document.all.RollImg.filters.blendTrans.play();
    	
    	if(cliImg == '') {
    		cliImg = ci;
    		cliImgSrc = ci.src;
    		ci.src = numimg[n];
    	} else if(cliImg != ci) {
    		cliImg.src = cliImgSrc;
    		cliImg = ci;
    		cliImgSrc = ci.src;
    		ci.src = numimg[n];
    	}
    }
    
    //-->
    </script>
    <table width="500" height="170" border="0" cellpadding="0" cellspacing="0">
      <tr> 
        <td><a href="http://ttt.sdo.com/web1.0/News.asp?a=1&CategoryID=1&ID=136" name="RollUrl" target="_blank" onFocus="this.blur()" ><img src="images/ad/ad060418.jpg"  border="0" name="RollImg" style="filter:blendTrans(duration=2);"width="500" height="140"></a></td>
      </tr>
      <tr> 
        <td height="33" align="right" valign="bottom"><table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr> 
              <td><img src="images/ttt.gif" width="202" height="26"></td>
              <td align="right"><Table border="0" cellpadding="0" cellspacing="0">
    
                  <tr> 
                    <td valign="bottom" style="padding-bottom:2px;">&nbsp;</td>
                    <td style="padding-bottom:2px;"><img src="images/01_01.gif" name="num_img0" width="29" height="22" border="0" align="absmiddle" style="cursor:hand" onClick="chki(this, 0);"></td>
                    <td style="padding-bottom:2px;"><img src="images/02_01.gif" name="num_img1" width="29" height="22" border="0" align="absmiddle" style="cursor:hand" onClick="chki(this, 1);"></td>
                    <td style="padding-bottom:2px;"><img src="images/03_01.gif" name="num_img2" width="29" height="22" border="0" align="absmiddle" style="cursor:hand" onClick="chki(this, 2);"></td>
                    <td style="padding-bottom:2px;"><img src="images/04_01.gif" name="num_img3" width="29" height="22" border="0" align="absmiddle" style="cursor:hand" onClick="chki(this, 3);"></td>
                    <td style="padding-bottom:2px;"><img src="images/05_01.gif" name="num_img4" width="29" height="22" border="0" align="absmiddle" style="cursor:hand" onClick="chki(this, 4);"></td>
    				<td style="padding-bottom:2px;"><img src="images/06_01.gif" name="num_img5" width="29" height="22" border="0" align="absmiddle" style="cursor:hand" onClick="chki(this, 5);"></td>
                  </tr>
    
                </TABLE></td>
            </tr>
          </table>
          
        </td>
      </tr>
    </table>
    <SCRIPT LANGUAGE="JavaScript">
    <!--
    rotateStart();
    //-->
    </SCRIPT>
    </body>
    </html>
     
  2. 不学无术

    不学无术 Ulysses 的元神

    注册:
    2005-08-31
    帖子:
    16,714
    赞:
    39
    有 IE 滤镜效果, FF 下面无效。而且 FF 下面不能自动更换。

    看看再说。
     
  3. gojorare

    gojorare New Member

    注册:
    2006-03-05
    帖子:
    87
    赞:
    0
    不错的效果哦,谢谢
    我在RSS上看到,特地来回你一下
     
  4. 不学无术

    不学无术 Ulysses 的元神

    注册:
    2005-08-31
    帖子:
    16,714
    赞:
    39
    改造过的,没有滤镜转换效果,但是在 FF 下面可以自动切换图片了。

    HTML:
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>Untitled Document</title>
    <style type="text/css">
    <!--
    body {
    	margin-left: 0px;
    	margin-top: 0px;
    	margin-right: 0px;
    	margin-bottom: 0px;
    }
    -->
    </style></head>
    
    <body topmargin="3">
    <table width="500" height="3" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td><img src="images/ad/blank.gif" width="1" height="1"></td>
      </tr>
    </table>
    
    <!-- rotate -->		
    <script>
    var fadeimages = new Array;
    var linkarr = new Array;
    var numimg = new Array;
    	fadeimages[0] = 'http://ttt.sdo.com/web1.0/images/ad/ad060418.jpg';
    	linkarr[0] = 'http://ttt.sdo.com/web1.0/News.asp?a=1&CategoryID=1&ID=136';
    	numimg[0] = 'http://ttt.sdo.com/web1.0/images/01_02.gif';
    
    	fadeimages[1] = 'http://ttt.sdo.com/web1.0/images/ad/ad05.gif';
    	linkarr[1] = 'http://ttt.sdo.com/project/test/event4.asp';
    	numimg[1] = 'http://ttt.sdo.com/web1.0/images/02_02.gif';
    	
    	fadeimages[2] = 'http://ttt.sdo.com/web1.0/images/ad/ad01.gif';
    	linkarr[2] = 'http://ttt.sdo.com/project/media/';
    	numimg[2] = 'http://ttt.sdo.com/web1.0/images/03_02.gif';
    	
    	fadeimages[3] = 'http://ttt.sdo.com/web1.0/images/ad/ad02.gif';
    	linkarr[3] = 'http://ttt.sdo.com';
    	numimg[3] = 'http://ttt.sdo.com/web1.0/images/04_02.gif';
    	
    	fadeimages[4] = 'http://ttt.sdo.com/web1.0/images/ad/ad03.gif';
    	linkarr[4] = 'http://ttt.sdo.com';
    	numimg[4] = 'http://ttt.sdo.com/web1.0/images/05_02.gif';
    
    	fadeimages[5] = 'http://ttt.sdo.com/web1.0/images/ad/ad04.gif';
    	linkarr[5] = 'http://ttt.sdo.com';
    	numimg[5] = 'http://ttt.sdo.com/web1.0/images/06_02.gif';
    	
    var cliImg = '';
    var cliImgSrc = '';
    var n = Math.round(Math.random() * 10);
    var interval = 7000;
    var setTimeId = '';
    
    function rotateStop()
    {
    	clearTimeout(setTimeId);
    }
    
    function rotateStart()
    {
    	rotate();
    }
    
    function chki(ci, no)
    {
    	var pImg = document.all.RollImg;
    	var pUrl = document.all.RollUrl;
    
    	if(cliImg == '') {
    		cliImg = ci;
    		cliImgSrc = ci.src;
    		ci.src = numimg[no];
    		n=no;
    		pImg.src = fadeimages[no];
    		pUrl.href = linkarr[no];		
    	} else if(cliImg != ci) {
    		cliImg.src = cliImgSrc;
    		cliImg = ci;
    		cliImgSrc = ci.src;
    		ci.src = numimg[no];
    		n=no;
    		pImg.src = fadeimages[no];
    		pUrl.href = linkarr[no];		
    	}
    }
    
    function rotate()
    {
    	n = (n >= 3) ? 0 : n+1;
    	setimgurl();
    	setTimeId=setTimeout("rotate()",interval);
    }
    
    function setimgurl()
    {
    	var ci = eval('document.all.num_img'+n);
    	if (document.all) {
    	    document.all.RollImg.filters.blendTrans.apply();
    	    document.all.RollUrl.href=linkarr[n];
    	    document.all.RollImg.src=fadeimages[n];
    	    document.all.RollImg.filters.blendTrans.play();
    	}
    	else {
    	    //document.getElementById("RollImg").filters.blendTrans.apply();
    	    document.getElementById("RollUrl").href=linkarr[n];
    	    document.getElementById("RollImg").src=fadeimages[n];
    	    //document.getElementById("RollImg").filters.blendTrans.play();
    	}
    	
    	if(cliImg == '') {
    		cliImg = ci;
    		cliImgSrc = ci.src;
    		ci.src = numimg[n];
    	} else if(cliImg != ci) {
    		cliImg.src = cliImgSrc;
    		cliImg = ci;
    		cliImgSrc = ci.src;
    		ci.src = numimg[n];
    	}
    }
    
    //-->
    </script>
    <table width="500" height="170" border="0" cellpadding="0" cellspacing="0">
      <tr> 
        <td><a href="http://ttt.sdo.com/web1.0/News.asp?a=1&CategoryID=1&ID=136" name="RollUrl" id="RollUrl" target="_blank" onFocus="this.blur()" ><img src="images/ad/ad060418.jpg"  border="0" name="RollImg" id="RollImg" style="filter:blendTrans(duration=2);"width="500" height="140"></a></td>
      </tr>
      <tr> 
        <td height="33" align="right" valign="bottom"><table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr> 
              <td><img src="http://ttt.sdo.com/web1.0/images/ttt.gif" width="202" height="26"></td>
              <td align="right"><Table border="0" cellpadding="0" cellspacing="0">
    
                  <tr> 
                    <td valign="bottom" style="padding-bottom:2px;">&nbsp;</td>
                    <td style="padding-bottom:2px;"><img src="http://ttt.sdo.com/web1.0/images/01_01.gif" name="num_img0" width="29" height="22" border="0" align="absmiddle" style="cursor:hand" onClick="chki(this, 0);"></td>
                    <td style="padding-bottom:2px;"><img src="http://ttt.sdo.com/web1.0/images/02_01.gif" name="num_img1" width="29" height="22" border="0" align="absmiddle" style="cursor:hand" onClick="chki(this, 1);"></td>
                    <td style="padding-bottom:2px;"><img src="http://ttt.sdo.com/web1.0/images/03_01.gif" name="num_img2" width="29" height="22" border="0" align="absmiddle" style="cursor:hand" onClick="chki(this, 2);"></td>
                    <td style="padding-bottom:2px;"><img src="http://ttt.sdo.com/web1.0/images/04_01.gif" name="num_img3" width="29" height="22" border="0" align="absmiddle" style="cursor:hand" onClick="chki(this, 3);"></td>
                    <td style="padding-bottom:2px;"><img src="http://ttt.sdo.com/web1.0/images/05_01.gif" name="num_img4" width="29" height="22" border="0" align="absmiddle" style="cursor:hand" onClick="chki(this, 4);"></td>
    				<td style="padding-bottom:2px;"><img src="http://ttt.sdo.com/web1.0/images/06_01.gif" name="num_img5" width="29" height="22" border="0" align="absmiddle" style="cursor:hand" onClick="chki(this, 5);"></td>
                  </tr>
    
                </TABLE></td>
            </tr>
          </table>
          
        </td>
      </tr>
    </table>
    <SCRIPT LANGUAGE="JavaScript">
    <!--
    rotateStart();
    //-->
    </SCRIPT>
    </body>
    </html>
    
     
    已获得 西子宜 的点赞。
  5. swenge

    swenge New Member

    注册:
    2005-11-28
    帖子:
    386
    赞:
    1
    这个不错!
     
  6. Pizza

    Pizza New Member

    注册:
    2005-09-04
    帖子:
    1,377
    赞:
    6
    :heart:
     
  7. srsman

    srsman Active Member

    注册:
    2005-11-08
    帖子:
    1,920
    赞:
    6
    挖哇哇!
     
  8. Hoofei

    Hoofei New Member

    注册:
    2005-12-10
    帖子:
    3,162
    赞:
    35
    不错,收藏了。谢谢。。
     
  9. fen

    fen New Member

    注册:
    2005-12-18
    帖子:
    3,050
    赞:
    25
    跳跳堂是什么游戏啊??
     
  10. bssn

    bssn New Member

    注册:
    2006-03-11
    帖子:
    46
    赞:
    0
    我有个和这个类似的代码 呵呵
     
  11. Kevin

    Kevin New Member

    注册:
    2005-10-23
    帖子:
    12,728
    赞:
    55
    照样收藏!谢谢!