图片移动导览 |
|
图片移动导览:
1、在<head>与</head>之间加入代码
<SCRIPT language=javascript>
function gdnewsl(news_id,news_name,news_link,news_content)
{
this.news_id=news_id;
this.news_name=news_name;
this.news_link=news_link;
this.news_content=news_content;
}
newsl=new Array();
newsl[1]=new gdnewsl('1','迷人风光','mrfg.htm','<img src=images/mrfg/smrfg001.jpg width=138 height=100 border=0 alt=ccd论坛朋友奉献给您迷人的风光>');
newsl[2]=new gdnewsl('2','奇花异草','qhyc.htm','<img src=images/qhyc/sqhyc001.jpg width=133 height=100 border=0 alt=奇花异草,见所未见>');
newsl[3]=new gdnewsl('3','天堂杭州','zjhz.htm','<img src=images/zjhzs001.jpg width=135 height=100 border=0 alt=梦幻般的杭州 >');
newsl[4]=new gdnewsl('4','诗情画意','sqhy/sqhy001.htm','<img src=sqhy/sqhy002s.jpg width=122 height=100 border=0 alt=名诗配画,精湛绝伦 >');
newsl[5]=new gdnewsl('5','画意诗情','left/left.htm','<img src=left/img/34ds.jpg width=120 height=100 border=0 alt=几米的名画配诗一般的文字,绝伦精湛>');
newsl[6]=new gdnewsl('6','特效图展','txtp001.htm','<img src=images/txtp001s.jpg width=133 height=100 border=0 alt=神奇特效图片,过目难忘>');
newsl[7]=new gdnewsl('7','世界名胜','sjms.htm','<img src=images/sjms/ssjms001.jpg width=133 height=100 border=0 alt=世界名胜60幅高清晰壁纸>');
newsl[8]=new gdnewsl('8','西藏风情','xizfg.htm','<img src=images/xiz001s.jpg width=133 height=100 border=0 alt=这是一片神奇的土地>');
newsl[9]=new gdnewsl('9','九寨沟图','jzgfg.htm','<img src=images/jzgfg/sjzgfg002.jpg width=133 height=100 border=0 alt=九寨沟,只应天上有此景>');
newsl[10]=new gdnewsl('10','秋意浓浓','jin009.htm','<img src=images/dengdai0s.jpg width=133 height=100 border=0 alt=如蝶秋叶,款款飘零>');
newsl[11]=new gdnewsl('11','张家界景','zjjfg.htm','<img src=images/zjjfg004s.jpg width=133 height=100 border=0 alt=妙哉!张家界>');
newsl[12]=new gdnewsl('12','flash音画','yflash001.htm','<img src=images/tongnidzrs.jpg width=133 height=100 border=0 alt=flash精品展示,不精不收 >');
newsl[13]=new gdnewsl('13','证券论坛','http://ccd01.xilubbs.com','<img src=images/ddh037.gif width=70 height=100 border=0 alt=黑马多多,人才济济>');
isns = navigator.appName == "Netscape";
function initl()
{
if(isns)
{
tag0='document.divnewsl.document.clipnewsl.document.'
tag1='document.divnewsl.document.clipnewsl.'
tag2=''
}
else
{
tag0=''
tag1=''
tag2='.style'
}
newsnuml=newsl.length-1
if(isns) eval(tag1+'clip.width=800')
eval(tag0+'newsl1'+tag2+'.left=0')
if(isns) eval(tag1+'visibility="show"')
if(newsnuml>5) newsmovel()
}
stephl=1
nnl=false
strtnum=false
widthlimit=665
function newsmovel()
{
nnl=true
strtnum=true
xminl=1
for(i=1;i<=newsnuml;i++)
{
if(isns) xleft=eval(tag0+'newsl'+xminl+'.left')
else xleft=eval('newsl'+xminl+'.style.pixelLeft')
if(isns) nileft=eval(tag0+'newsl'+i+'.left')
else nileft=eval('newsl'+i+'.style.pixelLeft')
if(nileft<xleft) xminl=i
}
if(isns) tt=eval(tag0+'newsl'+xminl+'.left');
else tt=eval('newsl'+xminl+'.style.pixelLeft');
tt-=stephl;
eval(tag0+'newsl'+xminl+tag2+'.left=tt');
xmaxl=xminl-1
if(xminl==1) xmaxl=newsnuml
if(xminl>=1&&xminl<newsnuml)
for(i=xminl+1;i<=newsnuml;i++)
{
j=i-1
followl(i,j)
}
if(xminl!=1)
for(i=1;i<=xmaxl;i++)
{
j=i-1
if(j==0) j=newsnuml
followl(i,j)
}
for(i=1;i<=newsnuml;i++)
{
if(isns) lefti=eval(tag0+'newsl'+i+'.left')
else lefti=eval('newsl'+i+'.style.pixelLeft')
if(isns) widthi=eval(tag0+'newsl'+i+'.clip.width')
else widthi=eval('newsl'+i+'.offsetWidth')
righti=lefti+widthi
if(righti<-14)
eval(tag0+'newsl'+i+tag2+'.left=widthlimit')
}
if(nnl) domovel=setTimeout('newsmovel()',20);
}
function stopml()
{
if(nnl)
{clearTimeout(domovel)
nnl=false}
}
function startml()
{
if(!nnl&&strtnum) newsmovel()
}
function followl(nexti,prei)
{
if(isns) newleft=eval(tag0+'newsl'+prei+'.left')
else newleft=eval('newsl'+prei+'.style.pixelLeft')
if(isns) newwidth=eval(tag0+'newsl'+prei+'.clip.width')
else newwidth=eval('newsl'+prei+'.offsetWidth')
newpos=newleft+newwidth+0
if(newpos>widthlimit) newpos=widthlimit
eval(tag0+'newsl'+nexti+tag2+'.left='+newpos)
}
</SCRIPT>
2、body后加入:<body onload="initl()">
3、在<body>与</body>区域中加入表格控制:
<div align="center">
<center>
<table border="0" width="83%" height="27">
<tr>
<td width="100%" height="23"></td>
</tr>
</table>
</center>
</div>
<table width="278" border="0" cellspacing="0" cellpadding="0" align="center" class=p9 height="96">
<tr>
<td width="407" valign="top" height="96" bordercolor="#FF00FF">
<table width="154" border="1" cellspacing="1" align="center" class="p9" height="99" bordercolor="#D8DDB5">
<tr>
<td style="background-repeat: no-repeat; border-left: 1 solid #4A9D4D; border-right: 1 solid #4A9D4D; border-top: 0 solid #4A9D4D; border-bottom: 0 solid #4A9D4D; background-position: center 50%" height="99" width="406" >
<NOLAYER>
<DIV id=divnewsl
style="LEFT: 0px; WIDTH: 665px; POSITION: relative; TOP: -51px">
<DIV id=clipnewsl
style="left: 0; width: 665; clip: rect(0px 665px 133px 0px); position: absolute; top: 0; height: 19">
4、在<body>与</body>区域中加入代码:
<SCRIPT language=javascript>
aal=''
for(i=1;i<newsl.length;i++)
{
dd=(i-1)*104
if(i>6) dd=665
aal="<div id=newsl"+i+" style='position:absolute;left:"+dd+"'>"
if(newsl[i].news_link!='')
aal+="<table cellpadding=2 bgcolor=#ffffff cellspacing=0 border=0 class=p9><tr><td align=center valign=top><a href="+newsl[i].news_link+" target=_blank onmouseover=stopml() onmouseout=startml()>"+newsl[i].news_content+"</a><br><img src=images/public/spacer.gif width=1 height=5><br><span class=default-text><a href="+newsl[i].news_link+" target=_blank onmouseover=stopml() onmouseout=startml()>"+newsl[i].news_name+"</a></span></td></tr></table></div>"
else
aal+=newsl[i].news_content+newsl[i].news_name+"</div>"
document.write(aal)
}
</SCRIPT>