帮你把qq网页上图片滚动的js代码截下来了,把滚动页面的url换成你自己的就可以了<table width="750" height="146" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#333333">
<tr>
<td><TABLE width="740" height="136" border=0 align=center cellPadding=0 cellSpacing=0 bgcolor="#DDDDDD">
<TBODY>
<TR>
<TD width=30 align="center" background="http://mat1.qq.com/news/images1/08photo/line.gif" class="ku13">栏<br>
目<br>焦<br>点</TD> <TD vAlign=top width=2 class=bo><img src="http://mat1.qq.com/news/images1/08photo/line1.gif" width="2" height="136"></TD>
<TD align=middle background="http://mat1.qq.com/news/images1/08photo/line.gif">
<SCRIPT language=JavaScript>
var dde_para = new Array();
var dde_aa = new Array();
var dde_url = document.location.href;
var dde_pp = dde_url.split("#")[1];
var jspfile = 1;
var para = null;//滚动页面的宽
var scrollwidth = 705;//滚动页面的高
var scrollheight = 120;if(dde_pp!=null && dde_pp.length>0){
dde_para = dde_pp.split("&");}
for(i=0; dde_para!=null && i<dde_para.length;i++){
dde_aa = dde_para[i].split("=");
eval("var "+dde_aa[0] +"='"+dde_aa[1]+"'");}
var car_num = 5;
var i=1;
//默认滚动时间10秒
var pausebetweenimages=800 * 8;
var slideimages=new Array();
//滚动页面1的URL
slideimages[0]="<iframe border=0 vspace=0 hspace=0 bgcolor=#888888 Name=union163com align=center marginwidth=0 marginheight=0 framespacing=0 frameborder=0 scrolling=no width="+scrollwidth+" height="+scrollheight+" src='http://news.qq.com/photon/08photojdlm1.htm'></iframe>";
//滚动页面2的URL
slideimages[1]="<iframe border=0 vspace=0 hspace=0 bgcolor=#888888 Name=union163com align=center marginwidth=0 marginheight=0 framespacing=0 frameborder=0 scrolling=no width="+scrollwidth+" height="+scrollheight+" src='http://news.qq.com/photon/08photojdlm1.htm'></iframe>";
function move1(whichdiv){
tdiv=eval(whichdiv)
if (tdiv.style.pixelTop>0&&tdiv.style.pixelTop<=car_num){
tdiv.style.pixelTop=0
setTimeout("move1(tdiv)",pausebetweenimages)
setTimeout("move2(second2)",pausebetweenimages)
return}
if (tdiv.style.pixelTop>=tdiv.offsetHeight*-1){
tdiv.style.pixelTop-=car_num
setTimeout("move1(tdiv)",50)}
else{
tdiv.style.pixelTop=scrollheight
tdiv.innerHTML=slideimages[0]
if (i==slideimages.length-1)
i=0
else i++}}
function move2(whichdiv){
tdiv2=eval(whichdiv)
if (tdiv2.style.pixelTop>0&&tdiv2.style.pixelTop<=car_num){
tdiv2.style.pixelTop=0
setTimeout("move2(tdiv2)",pausebetweenimages)
setTimeout("move1(first2)",pausebetweenimages)
return}
if (tdiv2.style.pixelTop>=tdiv2.offsetHeight*-1){
tdiv2.style.pixelTop-=car_num
setTimeout("move2(second2)",50)}
else{
tdiv2.style.pixelTop=scrollheight
tdiv2.innerHTML=slideimages[1]
if (i==slideimages.length-1)
i=0
else i++}}
function conmouse(){car_num=0;}
function cmouseout(){car_num=5;}
function startscroll(){
if (document.all){
move1(first2)
second2.style.top=scrollheight
}
else if (document.layers){
move1(document.main.document.first)
document.main.document.second.top=scrollheight+5
document.main.document.second.visibility='show'}}
//-->
</SCRIPT>
<ILAYER id=main height="&{scrollheight};"
width="&{scrollwidth};"><LAYER name="first" left="0"
top="1" width="&{scrollwidth};" id=first>
<SCRIPT language=JavaScript1.2>
if (document.layers)
document.write(slideimages[0])
</SCRIPT>
</LAYER><LAYER id=second width="&{scrollwidth};" top="0" left="0"
visibility="hide">
<SCRIPT language=JavaScript1.2>
if (document.layers)
document.write(slideimages[1])
</SCRIPT> </LAYER></ILAYER>
<script language=JavaScript1.2>
if (document.all){
document.writeln('<span id="main2" style="position:relative;width:'+scrollwidth+';height:'+scrollheight+';overflow:hiden;background-color:#ffffff">')
document.writeln('<div onMouseOver="conmouse()" onMouseOut="cmouseout()" style="position:absolute;width:'+scrollwidth+';height:'+scrollheight+';clip:rect(0 '+scrollwidth+' '+scrollheight+' 0);left:0;top:0">')
document.writeln('<div id="first2" style="position:absolute;width:'+scrollwidth+';left:0;top:1;">')
document.write(slideimages[0])
document.writeln('</div>')
document.writeln('<div id="second2" style="position:absolute;width:'+scrollwidth+';left:0;top:0">')
document.write(slideimages[1])
document.writeln('</div>')
document.writeln('</div>')
document.writeln('</span>')}
startscroll();
</script> </TD>
</TR>
<TR bgColor=#bcbcbc></TR></TBODY></TABLE>
</td>
</tr>
</table>
<tr>
<td><TABLE width="740" height="136" border=0 align=center cellPadding=0 cellSpacing=0 bgcolor="#DDDDDD">
<TBODY>
<TR>
<TD width=30 align="center" background="http://mat1.qq.com/news/images1/08photo/line.gif" class="ku13">栏<br>
目<br>焦<br>点</TD> <TD vAlign=top width=2 class=bo><img src="http://mat1.qq.com/news/images1/08photo/line1.gif" width="2" height="136"></TD>
<TD align=middle background="http://mat1.qq.com/news/images1/08photo/line.gif">
<SCRIPT language=JavaScript>
var dde_para = new Array();
var dde_aa = new Array();
var dde_url = document.location.href;
var dde_pp = dde_url.split("#")[1];
var jspfile = 1;
var para = null;//滚动页面的宽
var scrollwidth = 705;//滚动页面的高
var scrollheight = 120;if(dde_pp!=null && dde_pp.length>0){
dde_para = dde_pp.split("&");}
for(i=0; dde_para!=null && i<dde_para.length;i++){
dde_aa = dde_para[i].split("=");
eval("var "+dde_aa[0] +"='"+dde_aa[1]+"'");}
var car_num = 5;
var i=1;
//默认滚动时间10秒
var pausebetweenimages=800 * 8;
var slideimages=new Array();
//滚动页面1的URL
slideimages[0]="<iframe border=0 vspace=0 hspace=0 bgcolor=#888888 Name=union163com align=center marginwidth=0 marginheight=0 framespacing=0 frameborder=0 scrolling=no width="+scrollwidth+" height="+scrollheight+" src='http://news.qq.com/photon/08photojdlm1.htm'></iframe>";
//滚动页面2的URL
slideimages[1]="<iframe border=0 vspace=0 hspace=0 bgcolor=#888888 Name=union163com align=center marginwidth=0 marginheight=0 framespacing=0 frameborder=0 scrolling=no width="+scrollwidth+" height="+scrollheight+" src='http://news.qq.com/photon/08photojdlm1.htm'></iframe>";
function move1(whichdiv){
tdiv=eval(whichdiv)
if (tdiv.style.pixelTop>0&&tdiv.style.pixelTop<=car_num){
tdiv.style.pixelTop=0
setTimeout("move1(tdiv)",pausebetweenimages)
setTimeout("move2(second2)",pausebetweenimages)
return}
if (tdiv.style.pixelTop>=tdiv.offsetHeight*-1){
tdiv.style.pixelTop-=car_num
setTimeout("move1(tdiv)",50)}
else{
tdiv.style.pixelTop=scrollheight
tdiv.innerHTML=slideimages[0]
if (i==slideimages.length-1)
i=0
else i++}}
function move2(whichdiv){
tdiv2=eval(whichdiv)
if (tdiv2.style.pixelTop>0&&tdiv2.style.pixelTop<=car_num){
tdiv2.style.pixelTop=0
setTimeout("move2(tdiv2)",pausebetweenimages)
setTimeout("move1(first2)",pausebetweenimages)
return}
if (tdiv2.style.pixelTop>=tdiv2.offsetHeight*-1){
tdiv2.style.pixelTop-=car_num
setTimeout("move2(second2)",50)}
else{
tdiv2.style.pixelTop=scrollheight
tdiv2.innerHTML=slideimages[1]
if (i==slideimages.length-1)
i=0
else i++}}
function conmouse(){car_num=0;}
function cmouseout(){car_num=5;}
function startscroll(){
if (document.all){
move1(first2)
second2.style.top=scrollheight
}
else if (document.layers){
move1(document.main.document.first)
document.main.document.second.top=scrollheight+5
document.main.document.second.visibility='show'}}
//-->
</SCRIPT>
<ILAYER id=main height="&{scrollheight};"
width="&{scrollwidth};"><LAYER name="first" left="0"
top="1" width="&{scrollwidth};" id=first>
<SCRIPT language=JavaScript1.2>
if (document.layers)
document.write(slideimages[0])
</SCRIPT>
</LAYER><LAYER id=second width="&{scrollwidth};" top="0" left="0"
visibility="hide">
<SCRIPT language=JavaScript1.2>
if (document.layers)
document.write(slideimages[1])
</SCRIPT> </LAYER></ILAYER>
<script language=JavaScript1.2>
if (document.all){
document.writeln('<span id="main2" style="position:relative;width:'+scrollwidth+';height:'+scrollheight+';overflow:hiden;background-color:#ffffff">')
document.writeln('<div onMouseOver="conmouse()" onMouseOut="cmouseout()" style="position:absolute;width:'+scrollwidth+';height:'+scrollheight+';clip:rect(0 '+scrollwidth+' '+scrollheight+' 0);left:0;top:0">')
document.writeln('<div id="first2" style="position:absolute;width:'+scrollwidth+';left:0;top:1;">')
document.write(slideimages[0])
document.writeln('</div>')
document.writeln('<div id="second2" style="position:absolute;width:'+scrollwidth+';left:0;top:0">')
document.write(slideimages[1])
document.writeln('</div>')
document.writeln('</div>')
document.writeln('</span>')}
startscroll();
</script> </TD>
</TR>
<TR bgColor=#bcbcbc></TR></TBODY></TABLE>
</td>
</tr>
</table>
----------------------------------------
你还是没有明白我的意思.我不是不会截代码.我的意思.是我的页面只有一个.当是多行.我要一行行的象.QQ上的那样滚动.
--------------------------------------
但是.我第一次显示的是
第一行.再过10秒.又是第一行的内容.那还不如不做.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<meta http-equiv="content-type" content="text/html" charset="utf-8">
<link rel="stylesheet" type="text/css" href="">
<script type="text/javascript" language="javascript">
function showIt()
{
self.setInterval('showrand()',1000);
} function showrand()
{
var srcs = "./image";
var img = document.getElementById("imgs");
var rd = Math.random();
var rdd = Math.round(rd*10);
var no = 0;
if (rdd <1 )
{
no = 1;
}
else if ( rdd > 4 )
{
no = 4;
}
else
{
no = rdd;
}
img.src = srcs+no+".gif";
}</script>
</HEAD><BODY onload="showIt();">
<button onclick="showrand();">shows</button><br>
<button onclick="self.clearInterval();">stop</button><br>
<img id="imgs" src="./image/image1.gif">
</BODY>
</HTML>