读书人

在页面同一位置轮流播放图片

发布时间: 2012-10-24 14:15:58 作者: rapoo

在页面同一位置轮番播放图片?
如题,怎么实现?

[解决办法]

JScript code
<script type=text/javascript>                <!--                //var nPic = new Array(),nPiclink=new Array(),nPicTit=new Array(),preloadedimages=new Array();                var nPic = new Array(),nPiclink=new Array(),preloadedimages=new Array();                var nPicNum=0;                nPic[0]="../nntcn_image/pic/shua1.gif";                nPiclink[0]="#";                    preloadedimages[1]=new Image();                preloadedimages[1].src=nPic[0];//Modify2008-03-28 Author:xinghai.li                nPic[1]="../nntcn_image/pic/gg200809.gif";                nPiclink[1]="#";        preloadedimages[2]=new Image();                preloadedimages[2].src=nPic[1];//Modify2008-03-28 Author:xinghai.li                nPic[2]="../nntcn_image/pic/gg3.gif";                nPiclink[2]="#";                preloadedimages[3]=new Image();                preloadedimages[3].src=nPic[2];//Modify2008-03-28 Author:xinghai.li                nPic[3]="../nntcn_image/pic/gg2.gif";                nPiclink[3]="#";                function setTransition(){                    if(document.all) {                        document.getElementById('nPicRotator').filters.revealTrans.Transition=23;                        document.getElementById('nPicRotator').filters.revealTrans.apply();                    }                }                function playTransition(){                    if(document.all){                        //alert("nPicRotator" + document.getElementById('nPicRotator'));                        document.getElementById('nPicRotator').filters.revealTrans.play();                    }                }                function nextAd(){                    if(nPicNum < nPic.length-1){                        nPicNum++;                    } else {                        nPicNum=0;                    }                    midWay();                    theTimer=setTimeout("nextAd()",4000);                }                function midWay(){                setTransition();                document.getElementById('nPicRotator').src=nPic[nPicNum];                document.getElementById('nPicRotatorA').href=nPiclink[nPicNum];                                playTransition();                }                theTimer=setTimeout("nextAd()",4000);                //-->                </script> 

读书人网 >asp.net

热点推荐