| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 886 人关注过本帖
标题:islet,yms123,盖茨。。。。。进来啊
只看楼主 加入收藏
google
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:22
帖 子:3419
专家分:23
注 册:2005-11-1
结帖率:0
收藏
 问题点数:0 回复次数:5 
islet,yms123,盖茨。。。。。进来啊
http://www.csdn.net

首页模拟FLASH播放的那个是怎么做的?

我想学习一下,谢谢了啊!~

[此贴子已经被作者于2006-9-15 23:35:11编辑过]

搜索更多相关主题的帖子: islet 盖茨 
2006-09-15 23:34
盖茨他爹
Rank: 6Rank: 6
等 级:贵宾
威 望:28
帖 子:5255
专家分:0
注 册:2005-5-3
收藏
得分:0 
嘿嘿,没有偷不到的客户端

http://www.
2006-09-15 23:41
盖茨他爹
Rank: 6Rank: 6
等 级:贵宾
威 望:28
帖 子:5255
专家分:0
注 册:2005-5-3
收藏
得分:0 
adRotate.htm调用了一个JS
<script language='javascript' src="Resources/Script/adRotate.js"></script>
主要都是靠这个JS实现的,js文件的地址是http://www.
下面是JS文件的代码:

var preloadedimages = new Array() ;

var cpAD=new Array();
var cpADlink=new Array();
var cpADmsg=new Array();
var adNum=6;
var coll=0;

cpAD[0]="http://zi.
cpADlink[0]="http://z.
cpADmsg[0]="1";

cpAD[1]="http://zi.
cpADlink[1]="http://z.
cpADmsg[1]="2";

cpAD[2]="http://zi.
cpADlink[2]="http://z.
cpADmsg[2]="3";

cpAD[3]=" http://zi.
cpADlink[3]="http://z.
cpADmsg[3]="4";


cpAD[4]="http://zi.
cpADlink[4]="http://z.
cpADmsg[4]="5";

cpAD[5]="http://zi.
cpADlink[5]="http://z.
cpADmsg[5]="6";


for( i=1 ; i<cpAD.length ; i++ )
{
    //alert( cpAD.length + " -----(1-5) " + i ) ;
    preloadedimages[i] = new Image() ;
    preloadedimages[i].src = cpAD[i] ;
}

function jump2url()
{
    jumpUrl = cpADlink[adNum] ;
    jumpTarget = '_blank' ;
    if( jumpUrl != '' )
    {
        if(    jumpTarget != '' )
            window.open(jumpUrl,jumpTarget) ;
        else location.href = jumpUrl ;
    }
}


function changeimg( n )
{
    adNum = n-1 ;
    switch(n)
    {
        case 0:
        {
            //alert( "changeimg case 0 --- n=" + n +" --- " + "adNum = n-1 = " + adNum ) ;  
            document.all.img1.src="http://www.
            document.all.img2.src="http://www.
            document.all.img3.src="http://www.
            document.all.img4.src="http://www.
            document.all.img5.src="http://www.
            document.all.img6.src="http://www.
            break;
        }
        case 1:
        {
            document.all.img1.src="http://www.
            document.all.img2.src="http://www.
            document.all.img3.src="http://www.
            document.all.img4.src="http://www.
            document.all.img5.src="http://www.
            document.all.img6.src="http://www.
            break;
        }
        case 2:
        {
            document.all.img1.src="http://www.
            document.all.img2.src="http://www.
            document.all.img3.src="http://www.
            document.all.img4.src="http://www.
            document.all.img5.src="http://www.
            document.all.img6.src="http://www.
            break;
        }
        case 3:
        {
            document.all.img1.src="http://www.
            document.all.img2.src="http://www.
            document.all.img3.src="http://www.
            document.all.img4.src="http://www.
            document.all.img5.src="http://www.
            document.all.img6.src="http://www.
            break;
        }
        case 4:
        {
            //alert( "changeimg case 4 --- n=" + n +" --- " + "adNum = n-1 = " + adNum ) ;  
            document.all.img1.src="http://www.
            document.all.img2.src="http://www.
            document.all.img3.src="http://www.
            document.all.img4.src="http://www.
            document.all.img5.src="http://www.
            document.all.img6.src="http://www.
            break;
        }
        case 5:
        {
            document.all.img1.src="http://www.
            document.all.img2.src="http://www.
            document.all.img3.src="http://www.
            document.all.img4.src="http://www.
            document.all.img5.src="http://www.
            document.all.img6.src="http://www.
            break;
        }
    }

    window.clearInterval( theTimer ) ;
    nextAd();
}


function nextAd()
{
    //adNum = 6 --- coll= 0
    //alert( "nextAd" + " --- " + "adNum = " + adNum + " --- " + "coll = " + coll ) ;
    coll++;
    if( coll > 1 )
    {
        switch( adNum+1 )
        {
            case 0:
            {
                //alert( "nextAd --- switch( adNum+1 ) = " + adNum+1 + " --- " + "case 0 " + " --- " + "coll = " + coll + " --- " + "adNum=" + adNum ) ;  
                document.all.img1.src="http://www.
                document.all.img2.src="http://www.
                document.all.img3.src="http://www.
                document.all.img4.src="http://www.
                document.all.img5.src="http://www.
                document.all.img6.src="http://www.

                break;
            }
            case 1:
            {
                //adNum = 0
                //alert( "nextAd --- switch( adNum+1 ) = " + adNum+1 + " --- " + "case 1 " + " --- " + "coll = " + coll + " --- " + "adNum=" + adNum ) ;  

                document.all.img1.src="http://www.
                document.all.img2.src="http://www.
                document.all.img3.src="http://www.
                document.all.img4.src="http://www.
                document.all.img5.src="http://www.
                document.all.img6.src="http://www.
                break;
            }
            case 2:
            {
                //adNum = 1
                document.all.img1.src="http://www.
                document.all.img2.src="http://www.
                document.all.img3.src="http://www.
                document.all.img4.src="http://www.
                document.all.img5.src="http://www.
                document.all.img6.src="http://www.
                break;
            }
            case 3:
            {
                //adNum = 2
                document.all.img1.src="http://www.
                document.all.img2.src="http://www.
                document.all.img3.src="http://www.
                document.all.img4.src="http://www.
                document.all.img5.src="http://www.
                document.all.img6.src="http://www.
                break;
            }
            case 4:
            {
                //adNum = 3
                document.all.img1.src="http://www.
                document.all.img2.src="http://www.
                document.all.img3.src="http://www.
                document.all.img4.src="http://www.
                document.all.img5.src="http://www.
                document.all.img6.src="http://www.
                break;
            }
            case 5:
            {
                //adNum = 4
                document.all.img1.src="http://www.
                document.all.img2.src="http://www.
                document.all.img3.src="http://www.
                document.all.img4.src="http://www.
                document.all.img5.src="http://www.
                document.all.img6.src="http://www.
                break;
            }
            case 6:
            {
                //adNum = 5
                document.all.img1.src="http://www.
                document.all.img2.src="http://www.
                document.all.img3.src="http://www.
                document.all.img4.src="http://www.
                document.all.img5.src="http://www.
                document.all.img6.src="http://www.
                break;
            }
            case 7:
            {
                //alert( "nextAd case 6 : " + adNum ) ;
                //adNum = 6 , 调试大半天,原来是这里还要再加一个,否则到了最后一个回头显示第一个会一闪而过
                document.all.img1.src="http://www.
                document.all.img2.src="http://www.
                document.all.img3.src="http://www.
                document.all.img4.src="http://www.
                document.all.img5.src="http://www.
                document.all.img6.src="http://www.
                adNum=0;
                break;
            }
        }
    }

    if(adNum<cpAD.length-1)
    {
        document.images.cpADrush.src=cpAD[adNum];
        adNum++ ;
    }
    else
    {
        adNum=0;
        document.images.cpADrush.src=cpAD[adNum];
    }

    setTransition() ;
    document.images.cpADrush.src=cpAD[adNum] ;
    playTransition() ;
    displayStatusMsg() ;
    theTimer = setTimeout("nextAd()", 5000) ;
}


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


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


function displayStatusMsg()
{
    status = cpADmsg[adNum] ;
    document.returnValue = true;
}
2006-09-15 23:46
islet
Rank: 12Rank: 12Rank: 12
等 级:贵宾
威 望:89
帖 子:6548
专家分:0
注 册:2005-1-28
收藏
得分:0 

[CODE]<HTML>
<HEAD>
<title>轮换广告</title>
<meta content="JavaScript" name="vs_defaultClientScript">
<LINK href="http://www.dearbook.com.cn/CSS/dearbook2005.css" type="text/css" rel="stylesheet"></LINK>
<script language='javascript' >
var preloadedimages = new Array() ;
var cpAD=new Array();
var cpADlink=new Array();
var cpADmsg=new Array();
var adNum=6;
var coll=0;
cpAD[0]="http://zi.csdn.net/no1.280-187.gif";
cpADlink[0]="http://z.csdn.net/adclick.php?bannerid=395";
cpADmsg[0]="1";
cpAD[1]="http://zi.csdn.net/no2-280_187.gif";
cpADlink[1]="http://z.csdn.net/adclick.php?bannerid=459";
cpADmsg[1]="2";
cpAD[2]="http://zi.csdn.net/no3.gif";
cpADlink[2]="http://z.csdn.net/adclick.php?bannerid=401";
cpADmsg[2]="3";
cpAD[3]=" http://zi.csdn.net/no4.jpg";
cpADlink[3]="http://z.csdn.net/adclick.php?bannerid=410";
cpADmsg[3]="4";

cpAD[4]="http://zi.csdn.net/no5.jpg";
cpADlink[4]="http://z.csdn.net/adclick.php?bannerid=369";
cpADmsg[4]="5";
cpAD[5]="http://zi.csdn.net/no.6.280.187.gif";
cpADlink[5]="http://z.csdn.net/adclick.php?bannerid=372";
cpADmsg[5]="6";

for( i=1 ; i<cpAD.length ; i++ )
{
//alert( cpAD.length + " -----(1-5) " + i ) ;
preloadedimages[i] = new Image() ;
preloadedimages[i].src = cpAD[i] ;
}
function jump2url()
{
jumpUrl = cpADlink[adNum] ;
jumpTarget = '_blank' ;
if( jumpUrl != '' )
{
if( jumpTarget != '' )
window.open(jumpUrl,jumpTarget) ;
else location.href = jumpUrl ;
}
}

function changeimg( n )
{
adNum = n-1 ;
switch(n)
{
case 0:
{
//alert( "changeimg case 0 --- n=" + n +" --- " + "adNum = n-1 = " + adNum ) ;
document.all.img1.src="http://www.csdn.net/Images/adRotateImage/1-2.gif";
document.all.img2.src="http://www.csdn.net/Images/adRotateImage/2.gif";
document.all.img3.src="http://www.csdn.net/Images/adRotateImage/3.gif";
document.all.img4.src="http://www.csdn.net/Images/adRotateImage/4.gif";
document.all.img5.src="http://www.csdn.net/Images/adRotateImage/5.gif";
document.all.img6.src="http://www.csdn.net/Images/adRotateImage/6.gif";
break;
}
case 1:
{
document.all.img1.src="http://www.csdn.net/Images/adRotateImage/1.gif";
document.all.img2.src="http://www.csdn.net/Images/adRotateImage/2-2.gif";
document.all.img3.src="http://www.csdn.net/Images/adRotateImage/3.gif";
document.all.img4.src="http://www.csdn.net/Images/adRotateImage/4.gif";
document.all.img5.src="http://www.csdn.net/Images/adRotateImage/5.gif";
document.all.img6.src="http://www.csdn.net/Images/adRotateImage/6.gif";
break;
}
case 2:
{
document.all.img1.src="http://www.csdn.net/Images/adRotateImage/1.gif";
document.all.img2.src="http://www.csdn.net/Images/adRotateImage/2.gif";
document.all.img3.src="http://www.csdn.net/Images/adRotateImage/3-2.gif";
document.all.img4.src="http://www.csdn.net/Images/adRotateImage/4.gif";
document.all.img5.src="http://www.csdn.net/Images/adRotateImage/5.gif";
document.all.img6.src="http://www.csdn.net/Images/adRotateImage/6.gif";
break;
}
case 3:
{
document.all.img1.src="http://www.csdn.net/Images/adRotateImage/1.gif";
document.all.img2.src="http://www.csdn.net/Images/adRotateImage/2.gif";
document.all.img3.src="http://www.csdn.net/Images/adRotateImage/3.gif";
document.all.img4.src="http://www.csdn.net/Images/adRotateImage/4-2.gif";
document.all.img5.src="http://www.csdn.net/Images/adRotateImage/5.gif";
document.all.img6.src="http://www.csdn.net/Images/adRotateImage/6.gif";
break;
}
case 4:
{
//alert( "changeimg case 4 --- n=" + n +" --- " + "adNum = n-1 = " + adNum ) ;
document.all.img1.src="http://www.csdn.net/Images/adRotateImage/1.gif";
document.all.img2.src="http://www.csdn.net/Images/adRotateImage/2.gif";
document.all.img3.src="http://www.csdn.net/Images/adRotateImage/3.gif";
document.all.img4.src="http://www.csdn.net/Images/adRotateImage/4.gif";
document.all.img5.src="http://www.csdn.net/Images/adRotateImage/5-2.gif";
document.all.img6.src="http://www.csdn.net/Images/adRotateImage/6.gif";
break;
}
case 5:
{
document.all.img1.src="http://www.csdn.net/Images/adRotateImage/1.gif";
document.all.img2.src="http://www.csdn.net/Images/adRotateImage/2.gif";
document.all.img3.src="http://www.csdn.net/Images/adRotateImage/3.gif";
document.all.img4.src="http://www.csdn.net/Images/adRotateImage/4.gif";
document.all.img5.src="http://www.csdn.net/Images/adRotateImage/5.gif";
document.all.img6.src="http://www.csdn.net/Images/adRotateImage/6-2.gif";
break;
}
}
window.clearInterval( theTimer ) ;
nextAd();
}

function nextAd()
{
//adNum = 6 --- coll= 0
//alert( "nextAd" + " --- " + "adNum = " + adNum + " --- " + "coll = " + coll ) ;
coll++;
if( coll > 1 )
{
switch( adNum+1 )
{
case 0:
{
//alert( "nextAd --- switch( adNum+1 ) = " + adNum+1 + " --- " + "case 0 " + " --- " + "coll = " + coll + " --- " + "adNum=" + adNum ) ;
document.all.img1.src="http://www.csdn.net/Images/adRotateImage/1-2.gif";
document.all.img2.src="http://www.csdn.net/Images/adRotateImage/2.gif";
document.all.img3.src="http://www.csdn.net/Images/adRotateImage/3.gif";
document.all.img4.src="http://www.csdn.net/Images/adRotateImage/4.gif";
document.all.img5.src="http://www.csdn.net/Images/adRotateImage/5.gif";
document.all.img6.src="http://www.csdn.net/Images/adRotateImage/6.gif";
break;
}
case 1:
{
//adNum = 0
//alert( "nextAd --- switch( adNum+1 ) = " + adNum+1 + " --- " + "case 1 " + " --- " + "coll = " + coll + " --- " + "adNum=" + adNum ) ;
document.all.img1.src="http://www.csdn.net/Images/adRotateImage/1.gif";
document.all.img2.src="http://www.csdn.net/Images/adRotateImage/2-2.gif";
document.all.img3.src="http://www.csdn.net/Images/adRotateImage/3.gif";
document.all.img4.src="http://www.csdn.net/Images/adRotateImage/4.gif";
document.all.img5.src="http://www.csdn.net/Images/adRotateImage/5.gif";
document.all.img6.src="http://www.csdn.net/Images/adRotateImage/6.gif";
break;
}
case 2:
{
//adNum = 1
document.all.img1.src="http://www.csdn.net/Images/adRotateImage/1.gif";
document.all.img2.src="http://www.csdn.net/Images/adRotateImage/2.gif";
document.all.img3.src="http://www.csdn.net/Images/adRotateImage/3-2.gif";
document.all.img4.src="http://www.csdn.net/Images/adRotateImage/4.gif";
document.all.img5.src="http://www.csdn.net/Images/adRotateImage/5.gif";
document.all.img6.src="http://www.csdn.net/Images/adRotateImage/6.gif";
break;
}
case 3:
{
//adNum = 2
document.all.img1.src="http://www.csdn.net/Images/adRotateImage/1.gif";
document.all.img2.src="http://www.csdn.net/Images/adRotateImage/2.gif";
document.all.img3.src="http://www.csdn.net/Images/adRotateImage/3.gif";
document.all.img4.src="http://www.csdn.net/Images/adRotateImage/4-2.gif";
document.all.img5.src="http://www.csdn.net/Images/adRotateImage/5.gif";
document.all.img6.src="http://www.csdn.net/Images/adRotateImage/6.gif";
break;
}
case 4:
{
//adNum = 3
document.all.img1.src="http://www.csdn.net/Images/adRotateImage/1.gif";
document.all.img2.src="http://www.csdn.net/Images/adRotateImage/2.gif";
document.all.img3.src="http://www.csdn.net/Images/adRotateImage/3.gif";
document.all.img4.src="http://www.csdn.net/Images/adRotateImage/4.gif";
document.all.img5.src="http://www.csdn.net/Images/adRotateImage/5-2.gif";
document.all.img6.src="http://www.csdn.net/Images/adRotateImage/6.gif";
break;
}
case 5:
{
//adNum = 4
document.all.img1.src="http://www.csdn.net/Images/adRotateImage/1.gif";
document.all.img2.src="http://www.csdn.net/Images/adRotateImage/2.gif";
document.all.img3.src="http://www.csdn.net/Images/adRotateImage/3.gif";
document.all.img4.src="http://www.csdn.net/Images/adRotateImage/4.gif";
document.all.img5.src="http://www.csdn.net/Images/adRotateImage/5.gif";
document.all.img6.src="http://www.csdn.net/Images/adRotateImage/6-2.gif";
break;
}
case 6:
{
//adNum = 5
document.all.img1.src="http://www.csdn.net/Images/adRotateImage/1-2.gif";
document.all.img2.src="http://www.csdn.net/Images/adRotateImage/2.gif";
document.all.img3.src="http://www.csdn.net/Images/adRotateImage/3.gif";
document.all.img4.src="http://www.csdn.net/Images/adRotateImage/4.gif";
document.all.img5.src="http://www.csdn.net/Images/adRotateImage/5.gif";
document.all.img6.src="http://www.csdn.net/Images/adRotateImage/6.gif";
break;
}
case 7:
{
//alert( "nextAd case 6 : " + adNum ) ;
//adNum = 6 , 调试大半天,原来是这里还要再加一个,否则到了最后一个回头显示第一个会一闪而过
document.all.img1.src="http://www.csdn.net/Images/adRotateImage/1-2.gif";
document.all.img2.src="http://www.csdn.net/Images/adRotateImage/2.gif";
document.all.img3.src="http://www.csdn.net/Images/adRotateImage/3.gif";
document.all.img4.src="http://www.csdn.net/Images/adRotateImage/4.gif";
document.all.img5.src="http://www.csdn.net/Images/adRotateImage/5.gif";
document.all.img6.src="http://www.csdn.net/Images/adRotateImage/6.gif";
adNum=0;
break;
}
}
}
if(adNum<cpAD.length-1)
{
document.images.cpADrush.src=cpAD[adNum];
adNum++ ;
}
else
{
adNum=0;
document.images.cpADrush.src=cpAD[adNum];
}
setTransition() ;
document.images.cpADrush.src=cpAD[adNum] ;
playTransition() ;
displayStatusMsg() ;
theTimer = setTimeout("nextAd()", 5000) ;
}

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

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

function displayStatusMsg()
{
status = cpADmsg[adNum] ;
document.returnValue = true;
}
</script>
</HEAD>
<body MS_POSITIONING="GridLayout" leftmargin="0">
<table class="dearbookbox3" cellSpacing="2" cellPadding="0" width="100%" align="center" border="0">
<tr>
<td align="center" width="100%" height="100%">
<div style="WIDTH: 100%" align="center">
<A href="javascript:jump2url()">
<IMG id="cpADrush" style="FILTER: revealTrans(duration=2,transition=23)" height="187" src="" width="280" border="0" name="cpADrush">
</A>
</div>
</td>
</tr>
</table>

<table height="100%" cellSpacing="0" cellPadding="0" width="100%" align="center" border="0">
<tr>
<!--
<td vAlign="top" width="287" background="image/photobgl.gif">
script src="http://www.dearbook.com.cn/MainPage/scroll.js"></script>
</td>
-->
<td class="bookfont" vAlign="top" width="100%" background="/image/photobg2.gif">
<SCRIPT language="JavaScript">nextAd()</SCRIPT>
<div align="right">
<A onmouseover="changeimg(0)" href="#">
<IMG id="img1" onclick="changeimg(0)" height="16" src="http://www.csdn.net/Images/adRotateImage/1.gif" width="20" border="0" name="Image2">
</A>
<A onmouseover="changeimg(1)" href="#">
<IMG id="img2" onclick="changeimg(1)" height="16" src="http://www.csdn.net/Images/adRotateImage/2.gif" width="20" border="0" name="img2">
</A>
<A onmouseover="changeimg(2)" href="#">
<IMG id="img3" onclick="changeimg(2)" height="16" src="http://www.csdn.net/Images/adRotateImage/3.gif" width="20" border="0" name="img3">
</A>

<A onmouseover="changeimg(3)" href="#">
<IMG id="img4" onclick="changeimg(3)" height="16" src="http://www.csdn.net/Images/adRotateImage/4.gif" width="20" border="0" name="img4">
</A>


<A onmouseover="changeimg(4)" href="#">
<IMG id="img5" onclick="changeimg(4)" height="16" src="http://www.csdn.net/Images/adRotateImage/5.gif" width="20" border="0" name="img5">
</A>

<A onmouseover="changeimg(5)" href="#">
<IMG id="img6" onclick="changeimg(5)" height="16" src="http://www.csdn.net/Images/adRotateImage/6.gif" width="20" border="0" name="img6">
</A>


<!--


-->


</div>
</td>
</tr>
</table>


</body>
</HTML>[/CODE]

2006-09-15 23:52
islet
Rank: 12Rank: 12Rank: 12
等 级:贵宾
威 望:89
帖 子:6548
专家分:0
注 册:2005-1-28
收藏
得分:0 
楼上的还就没换头像了
2006-09-15 23:53
google
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:22
帖 子:3419
专家分:23
注 册:2005-11-1
收藏
得分:0 
谢谢了
谢谢了

祝天下所有母亲幸福安康!~
2006-09-15 23:57
快速回复:islet,yms123,盖茨。。。。。进来啊
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.049543 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved