posts - 15,  comments - 8,  trackbacks - 0

<!--begin:图片轮换开始-->
<script language=JavaScript>  
  
var   imgUrl=new   Array();  
  
var   imgLink=new   Array();  
  
var   imgTz=new   Array();  
  
var   buttonShow=1;  
  
var   buttonPos=1;  
  
var   buttonX;  
  
var   buttonY;  
  
var   bakularCode=""  
  
var   adNum=0;  
  
var   dakularCode="";  
  imgUrl[
1]="page2/001.jpg";  
  imgLink[
1]="http://www.csdn.net/";  
  imgTz[
1]="渔歌图";  
  imgUrl[
2]="page2/002.jpg";  
  imgLink[
2]="http://www.csdn.net/";  
  imgTz[
2]="结翰墨缘";  
  imgUrl[
3]="page2/003.jpg";  
  imgLink[
3]="http://www.csdn.net/";  
  imgTz[
3]="渔歌图2";  
  imgUrl[
4]="page2/004.jpg";  
  imgLink[
4]="http://www.csdn.net/";  
  imgTz[
4]="渔歌图3   ";  
  
var   imgPre=new   Array();  
  
for   (i=1;i<5;i++)  
  {  
          imgPre[i]
=new   Image();  
          imgPre[i].src
=imgUrl[i];  
    }  
  
function   setTransition()  
  {  
          
if   (document.all)  
          {  
                  imgUrlrotator.filters.blendTrans.duration
=2;//Math.floor(Math.random()*23)  
                  imgUrlrotator.filters.blendTrans.apply();  
          }  
  }  
  
function   playTransition()  
  {  
    
if   (document.all)  
    imgUrlrotator.filters.blendTrans.play()  
    }  
    
function   nextAd(toNum)  
    {  
          
if(adNum<imgUrl.length-1)  
          adNum
++   ;  
          
else  
          adNum
=1;  
        
if(toNum!=null)   adNum=toNum;  
        setTransition();  
    document.images.imgUrlrotator.src
=imgUrl[adNum];  
    document.getElementById('linktext').innerHTML
=imgTz[adNum];  
      document.images.imgUrlrotator.alt
='详细信息:'+imgTz[adNum];  
    document.getElementById('linktext').innerHTML
="<a   href="+imgLink[adNum]+"   target=_blank   class=px14-lh20>"+imgTz[adNum]+"</a>";    
    playTransition();  
    checkButton();  
    
if(toNum!=null)  
            {toNum
=null;theTimer=setTimeout("nextAd()",   3000);}  
    
else  
          {theTimer
=setTimeout("nextAd()",   3000);}  
    }  
  
function   jump2url()  
  {  
    jumpUrl
=imgLink[adNum];jumpTarget='_blank';  
          
if   (jumpUrl   !=   '')  
          {                 
if   (jumpTarget   !=   '')  
                  window.open(jumpUrl,jumpTarget);  
                  
else   location.href=jumpUrl;  
        }  
    }  
  
function   displayStatusMsg()  
  {  
          status
=imgLink[adNum];  
          document.returnValue   
=   true;  
    }  
  
function   checkButton()  
  {  
          
for(i=1;i<=imgUrl.length-1;i++)  
                  {
if(i==adNum)  
                          
//document.getElementById('bt'+i).style.backgroundColor='#00FF00';  
                          eval("bt"+i+".style.backgroundColor='#9B0000';bt"+i+".style.color='#FFFFFF';");  
                  
else  
                          eval(
"bt"+i+".style.backgroundColor='#CCCCCC';bt"+i+".style.color='#000000';");  
                  }  
  }  
  
function   dakularButtons()  
  {  
          
if(buttonShow==1)  
          {  
                  
switch(buttonPos)  
                  {  
                          
case   1:{buttonX=160+20-imgUrl.length*20;buttonY=16;break;}  
                          
case   2:{buttonX=160+20-imgUrl.length*20;buttonY=125;break;}  
                          
case   3:{buttonX=imgUrl.length*20-100;buttonY=16;break;}  
                          
case   4:{buttonX=imgUrl.length*20-100;buttonY=125;break;}  
  
case   5:{buttonX=imgUrl.length*20-100;buttonY=16;break;}  
                          
default:{buttonX=160+20-imgUrl.length*20;buttonY=16;break;}  
                  }  
                  
for(i=1;i<=imgUrl.length-1;i++)  
                  {  
                          dakularCode
=dakularCode+"<div   id='bt"+i+"'   style='display:inline;   height=14px;   width:20px;   border:1px   solid   #000000;   background-color:#f7f7f7;   color:#000000;   font-size:12px;   line-height:14px;   filter:Alpha(Opacity=50,   FinishOpacity=50,Style=2);'   align='center'   onMouseOver=this.style.backgroundColor='#FFFFFF';this.style.color='#000000';this.style.cursor='hand'   onMouseOut=checkButton();   onClick='clearTimeout(theTimer);nextAd("+i+");'>"+i+"</div>";  
                  }  
                  dakularCode
="<div   style='display:inline;   position:relative;left:"+buttonX+"px;   top:"+buttonY+"px;   z-index:1;'>"+dakularCode+"</div>";  
                  document.write(dakularCode);  
          }  
  }  
  
</script>
<table border="0" align="center" cellpadding="0" cellspacing="0"
    id
=newsTable
    
style="position: relative; top: -10px; right: 0px; font-size: 12px;">
    
<script language="javascript">dakularButtons();</script>
    
<tr>
        
<td>
            
<onMouseOver="displayStatusMsg();return   document.returnValue;"
                onMouseOut
="status='';" href="javascript:jump2url()"><img
                    
style="filter: blendTrans(duration = 2); border: 1px solid #000000"
                    src
="javascript:nextAd()" width=263 height=195 border=0
                    
name=imgUrlrotator alt="点击查看">
            
</a>
        
</td>
    
</tr>
    
<tr>
        
<td bgcolor="#f0f0f0" align="center"
            style
="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000;"
            height
="20">
            
<label id="linktext"></label>
        
</td>
    
</tr>
</table>
<!--begin:图片轮换结束-->
posted on 2008-07-04 20:40 lvq810 阅读(3860) 评论(1)  编辑  收藏 所属分类: Html/JavaScript/Ajax

只有注册用户登录后才能发表评论。


网站导航: