随时可见的Javascript图片轮换

待引入的Javascript

ContractedBlock.gif ExpandedBlockStart.gif Code
var TopNum=0;
var imgPre
=new Array();
var Topcount
=0;
for (i=1;i<=5;i++) {
    
if( (TopimgUrl[i]!=""&& (TopimgLink[i]!="") ) {
        Topcount
++;
    } 
else {
        
break;
    }
}
function TopplayTran(){
    
if (document.all)
        document.getElementById(
"AdInit").filters.revealTrans.play();
}
var key
=0;
function TopnextAd(){
    
if(TopNum<Topcount)TopNum++ ;
    
else TopNum=1;
    
    
if( key==0 ){
        key
=1;
    } 
else if (document.all){
        document.getElementById(
"AdInit").filters.revealTrans.Transition=23;
        document.getElementById(
"AdInit").filters.revealTrans.apply();
    TopplayTran();

    }
    document.getElementById(
"AdInit").src=TopimgUrl[TopNum];
    document.getElementById(
"focuscount").innerHTML=TopNum;
  
//document.getElementById("focustext").innerHTML="<a href="+TopimgLink[adNum]+" target=_blank>"+Topimgtext[adNum]+"</a>";
    setTimeout("TopnextAd()"5000); //控制时间
}

function TopnextAd2(){
    
if(TopNum<Topcount)TopNum++ ;
    
else TopNum=1;
    
    
if( key==0 ){
        key
=1;
    } 
else if (document.all){
        document.getElementById(
"AdInit").filters.revealTrans.Transition=23;
        document.getElementById(
"AdInit").filters.revealTrans.apply();
    TopplayTran();

    }
    document.getElementById(
"AdInit").src=TopimgUrl[TopNum];
    document.getElementById(
"focuscount").innerHTML=TopNum;
  
//document.getElementById("focustext").innerHTML="<a href="+TopimgLink[adNum]+" target=_blank>"+Topimgtext[adNum]+"</a>";
        
}
function TopprondAd(){
    
if(TopNum>1)TopNum-- ;
    
else TopNum=5;
    
    
if( key==0 ){
        key
=1;
    } 
else if (document.all){
        document.getElementById(
"AdInit").filters.revealTrans.apply();
        document.getElementById(
"AdInit").filters.revealTrans.Transition=23;
    TopplayTran();

    }
    document.images.AdInit.src
=TopimgUrl[TopNum];
    document.getElementById(
"focuscount").innerHTML=TopNum;
  
//document.getElementById("focustext").innerHTML="<a href="+TopimgLink[adNum]+" target=_blank>"+Topimgtext[adNum]+"</a>";
        
}
function TopgoUrl(){
window.open(TopimgLink[TopNum],
'_blank');
}

 

前台代码:

 

ContractedBlock.gif ExpandedBlockStart.gif Code
<script type="text/javascript" language="javascript">
var TopimgUrl=new Array();
var TopimgLink=new Array();
var Topimgtext=new Array();
</script>
<script language="javascript" type="text/javascript" src="/js/ForcePic.js"></script>
<div class="focus">
  
<href="javascript:TopgoUrl()"><img alt="" style="FILTER: revealTrans(duration=1,transition=5);border-color:black;color:#000000" src="javascript:TopnextAd()" width="393" height="196" name="AdInit" id="AdInit" class="ForcePic" /></a>
  
<div class="Forcectrl">
    
<div class="Forceright"><span id="focuscount">0</span>/5<href="javascript:TopprondAd()"><img alt="" src="/images/force_left.jpg" width="20" height="19" /></a><href="javascript:TopnextAd2()"><img src="/images/force_right.jpg" width="20" height="19" /></a></div>
    
<div class="indexContent_flashZ"><href="/newscenter/SlideList.aspx" target="_blank"><img src="/images/lightcity_button01.jpg" width="36" height="19" alt="幻灯" title="幻灯" /></a>&nbsp;&nbsp;<href="/Newscenter/ListByType.aspx?type=2" target="_blank"><img src="/images/lightcity_button02.jpg" width="36" height="19" alt="视频" title="视频" /></a>&nbsp;&nbsp;<href="/Newscenter/ListByType.aspx?type=3" target="_blank"><img src="/images/lightcity_button03.jpg" width="36" height="19" alt="图片" title="图片" /></a>&nbsp;&nbsp;<href="/Newscenter/ListByType.aspx?type=4" target="_blank"><img src="/images/lightcity_button04.jpg" width="36" height="19" alt="头条" title="头条" /></a>&nbsp;&nbsp;<href="/Newscenter/ListByType.aspx?type=5" target="_blank"><img src="/images/lightcity_button05.jpg" width="36" height="19" alt="热点" title="热点" /></a></div>
  
</div>
</div>
<script language="javascript" type="text/javascript">
TopimgUrl[
1]="http://192.168.0.101:7010/Panel/8b12c1e9-e566-4240-bc70-ca6a9cb26f3b.jpg";
Topimgtext[
1]="Force1";
TopimgLink[
1]="URL1";
TopimgUrl[
2]="http://192.168.0.101:7010/Panel/76cd0bf7-7ca0-487f-9f68-c9f6dea7d85e.jpg";
Topimgtext[
2]="Force2";
TopimgLink[
2]="URL2";
TopimgUrl[
3]="http://192.168.0.101:7010/Panel/5ff20a26-4e54-4e61-bee5-899e4bfa9514.jpg";
Topimgtext[
3]="Force3";
TopimgLink[
3]="URL3";
TopimgUrl[
4]="http://192.168.0.101:7010/Panel/ee9903c7-fba9-489c-9275-ae034cbdf67e.jpg";
Topimgtext[
4]="Force4";
TopimgLink[
4]="URL4";
TopimgUrl[
5]="http://192.168.0.101:7010/Panel/bc8b1b28-a60d-4b71-9759-ba5755f8e7cf.jpg";
Topimgtext[
5]="Force5";
TopimgLink[
5]="URL5";
TopnextAd();
</script> 

转载于:https://www.cnblogs.com/Miler/archive/2009/03/18/1415200.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值