教程中国
PHOTOSHOP CS9.0中文版 MAYA 8.5 FOR WINDOWS Corel Painter v9.0 Flash MX2004 中文版 Illustrator cs2 中文版
VC++6.0含sp6 中英文版 VB6.0 +sp6 简体中文版 Borland Delphi 7汉化版 MSDN for vb6.0中文版 Visual Studio 2005简体
教程中国下属 文件存储共享专家BIBIDU.COM 提供大型软件,教材,源码,电影,音乐,图书等下载 更多精品请点此进入
  您目前所在位置: 教程中国 >> 网页设计 >> Html >> 轮换广告显示源代码 RSS订阅
处理 SSI 文件时出错
轮换广告显示源代码
处理 SSI 文件时出错
   <script LANGUAGE="javascript">
<!--
var cpAD=new Array(); 
var cpADlink=new Array(); 
var cpADmsg=new Array(); 
//定义了5个数组
var adNum=5; 
var coll=0;

//ad/1.html 那时你链接的广告地址

cpAD[0]="banners/mba.gif"; 
cpADlink[0]="ad/1.html"; 
cpADmsg[0]="1"; 

cpAD[1]="banners/google.gif"; 
cpADlink[1]="ad/2.html"
cpADmsg[1]="2"; 

cpAD[2]="banners/2005.gif"; 
cpADlink[2]="ad/3.html"; 
cpADmsg[2]="3";

cpAD[3]="banners/cz8y.gif"; 
cpADlink[3]="ad/4.html"; 
cpADmsg[3]="4"; 

cpAD[4]="banners/JG_YUEDU.gif"; 
cpADlink[4]="ad/5.html"; 
cpADmsg[4]="5"; 

var preloadedimages=new Array(); 
for (i=1;i<cpAD.length;i++){ 
preloadedimages[i]=new Image(); 
preloadedimages[i].src=cpAD[i]; 


//跳转的URL地址
function jump2url()

jumpUrl=cpADlink[adNum]; 
jumpTarget=’_blank’; 
if (jumpUrl != ’’)

        if (jumpTarget != ’’)
                window.open(jumpUrl,jumpTarget); 
        else location.href=jumpUrl; 
        } 
}

//图片变化的函数
function changeimg(n)
{
        adNum=n;
        switch(adNum)
        {
        case 0:
        {
                window.img1.src="http://www.525asp.com/News/banners/1-2.gif";
                window.img2.src="http://www.525asp.com/News/banners/2.gif";
                window.img3.src="http://www.525asp.com/News/banners/3.gif";
                window.img4.src="http://www.525asp.com/News/banners/4.gif";
                window.img5.src="http://www.525asp.com/News/banners/5.gif";
                break;
        }
        case 1:
        {
                window.img1.src="http://www.525asp.com/News/banners/1.gif";
                window.img2.src="http://www.525asp.com/News/banners/2-2.gif";
                window.img3.src="http://www.525asp.com/News/banners/3.gif";
                window.img4.src="http://www.525asp.com/News/banners/4.gif";
                window.img5.src="http://www.525asp.com/News/banners/5.gif";
                break;
        }
        case 2:
        {
                window.img1.src="http://www.525asp.com/News/banners/1.gif";
                window.img2.src="http://www.525asp.com/News/banners/2.gif";
                window.img3.src="http://www.525asp.com/News/banners/3-2.gif";
                window.img4.src="http://www.525asp.com/News/banners/4.gif";
                window.img5.src="http://www.525asp.com/News/banners/5.gif";
                break;
        }
                case 3:
        {
                window.img1.src="http://www.525asp.com/News/banners/1.gif";
                window.img2.src="http://www.525asp.com/News/banners/2.gif";
                window.img3.src="http://www.525asp.com/News/banners/3.gif";
                window.img4.src="http://www.525asp.com/News/banners/4-2.gif";
                window.img5.src="http://www.525asp.com/News/banners/5.gif";
                break;
        }
                case 4:
        {
                window.img1.src="http://www.525asp.com/News/banners/1.gif";
                window.img2.src="http://www.525asp.com/News/banners/2.gif";
                window.img3.src="http://www.525asp.com/News/banners/3.gif";
                window.img4.src="http://www.525asp.com/News/banners/4.gif";
                window.img5.src="http://www.525asp.com/News/banners/5-2.gif";
                break;
        }
        }
        window.clearInterval(theTimer);
        adNum=adNum-1;
        nextAd();
}
//当点击时直接跳转
function nextAd(){ 
coll++;
if(coll>1)
{
switch(adNum+1)
{
        case 5:
        {
                window.img1.src="http://www.525asp.com/News/banners/1-2.gif";
                window.img2.src="http://www.525asp.com/News/banners/2.gif";
                window.img3.src="http://www.525asp.com/News/banners/3.gif";
                window.img4.src="http://www.525asp.com/News/banners/4.gif";
                window.img5.src="http://www.525asp.com/News/banners/5.gif";
                break;
        }
        case 1:
        {
                window.img1.src="http://www.525asp.com/News/banners/1.gif";
                window.img2.src="http://www.525asp.com/News/banners/2-2.gif";
                window.img3.src="http://www.525asp.com/News/banners/3.gif";
                window.img4.src="http://www.525asp.com/News/banners/4.gif";
                window.img5.src="http://www.525asp.com/News/banners/5.gif";
                break;
        }
        case 2:
        {
                window.img1.src="http://www.525asp.com/News/banners/1.gif";
                window.img2.src="http://www.525asp.com/News/banners/2.gif";
                window.img3.src="http://www.525asp.com/News/banners/3-2.gif";
                window.img4.src="http://www.525asp.com/News/banners/4.gif";
                window.img5.src="http://www.525asp.com/News/banners/5.gif";
                break;
        }
        case 3:
        {
                window.img1.src="http://www.525asp.com/News/banners/1.gif";
                window.img2.src="http://www.525asp.com/News/banners/2.gif";
                window.img3.src="http://www.525asp.com/News/banners/3.gif";
                window.img4.src="http://www.525asp.com/News/banners/4-2.gif";
                window.img5.src="http://www.525asp.com/News/banners/5.gif";
                break;
        }
    case 4:
        {
                window.img1.src="http://www.525asp.com/News/banners/1.gif";
                window.img2.src="http://www.525asp.com/News/banners/2.gif";
                window.img3.src="http://www.525asp.com/News/banners/3.gif";
                window.img4.src="http://www.525asp.com/News/banners/4.gif";
                window.img5.src="http://www.525asp.com/News/banners/5-2.gif";
                break;
        }
}
}
if(adNum<cpAD.length-1)adNum++ ; 
else adNum=0; 
setTransition(); 
document.images.cpADrush.src=cpAD[adNum]; 
playTransition(); 
displayStatusMsg();
//定义了轮换时间 5s
theTimer=setTimeout("nextAd()", 5000); 


function setTransition(){ 
if (document.all){ 
cpADrush.filters.revealTrans.Transition=23; 
cpADrush.filters.revealTrans.apply(); 



function playTransition(){ 
if (document.all) 
cpADrush.filters.revealTrans.play() 

function displayStatusMsg() { 
status=cpADmsg[adNum]; 
document.returnValue = true; 

//结束
// -->

</script>



<table height="148" cellspacing="0" cellpadding="0">
              <tr> 
                <td> <a href="javascript:jump2url()"> <img style="FILTER: revealTrans(duration=2,transition=23)" height="150" src width="575" border="0" name="cpADrush"></a></td>
                <script language="JavaScript">nextAd()</script>
              </tr>
              <tr> 
                <td> 
                  <table width="575"  name="T1" id="T1" border="0" cellspacing="1" cellpadding="0">
                    <tr> 
                      <td align="right"><img src="http://www.525asp.com/News/banners/dh_bg.gif" width="178" height="16"></td>
                      <td width="20"><a href="#" onMouseOver="changeimg(0)"><img name="Image2"  id="img1" border="0" src="http://www.525asp.com/News/banners/1.gif" width="20" height="16" onClick="changeimg(0)"></a></td>
                      <td width="20"><a href="#" onMouseOver="changeimg(1)"><img name="Image3" id="img2" border="0" src="http://www.525asp.com/News/banners/2.gif" width="20" height="16" onClick="changeimg(1)"></a></td>
                      <td width="20"><a href="#" onMouseOver="changeimg(2)"><img name="Image4" id="img3" border="0" src="http://www.525asp.com/News/banners/3.gif" width="20" height="16" onClick="changeimg(2)"></a></td>
                      <td width="20"><a href="#" onMouseOver="changeimg(3)"><img name="Image5" id="img4" border="0" src="http://www.525asp.com/News/banners/4.gif" width="20" height="16" onClick="changeimg(3)"></a></td>
                      <td width="20"><a href="#" onMouseOver="changeimg(4)"><img name="Image6" id="img5" border="0" src="http://www.525asp.com/News/banners/5.gif" width="20" height="16" onClick="changeimg(4)"></a></td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>

来源:编程技术-十度教育
作者:
关键字:轮换广告显示源代码
发表日期:2006-10-18 10:53:21

处理 SSI 文件时出错

上一篇:一些音乐格式文件的链接语法   下一篇:关于网页源代码屏蔽


本文的相类似文章
网友评论 查看本文全部评论
笔 名: *
评 论:
最多500字。当前字数:0
联系方式:
验证码:
在学习中进步 在进步中成长 教程中国相随您的成长之路
华腾联合科技股份有限公司版权所有
广告联系:Rosibo@163.com