千刃龙 怎么打:我想知道网页中连续滚动的图片用dreamwever怎么做?

来源:百度文库 编辑:高考问答 时间:2024/05/07 08:29:17
谢谢了啊 拜托

你要做两个页面:PAGE1
代码如下:

<HTML><HEAD
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<STYLE type=text/css>BODY {
MARGIN: 0px
}
</STYLE>
<BODY onload=scrollnow()>

<SCRIPT language=JavaScript>
<!--//
var x = 0;
var y = 0;
var limdex =650; //滚动的总宽度,可调节
var dest = 0;
var distance = 0;
var step = 0;
var destination = 0;
var on = true;

function scrollit(destination) {
step = 2;
dest = destination;
if (x<dest & x < limdex){
while (x<dest) {
step += (step / 7);
x += step;
parent.frames[1].scroll(x,0);
}
// top.main.scroll(dest,0);
if(dest <=limdex) { parent.frames[1].scroll(dest,0); }
x = dest;
}
if (x > dest) {
while (x>dest) {
step += (step / 7);
if(x >= (0+step)) { x -= step; parent.frames[1].scroll(x,0); }
else break;
}
if(dest >= 0) { parent.frames[1].scroll(dest,0); }
x = dest;
}
if (x<1) { parent.frames[1].scroll(1,0); x=1 }
if (x>limdex) { parent.frames[1].scroll(limdex,0); x=limdex }
x = dest;
}

function scrollnow() {
if (on){
if (x < limdex & x >= 0 ) {
parent.frames[1].scroll(x,0);

x = x + 1;

setTimeout('scrollnow()', 25); // 调解滚动速度

}
else if (x < 0) {

x = limdex;
scrollnow();
}
else {

x=0;
scrollnow();
}
}

}

// *********************************
// 去掉原来的stopscroll()
function stopscroll() {
if (on){
on = false;
}
else {
on = true;
scrollnow();
}

}
function startscroll() { on = true; scrollnow(); }
function stop_start() {
if (on){ on = false;}else { on = true;scrollnow();}
}
//***********************************

//-->

</SCRIPT>

<TABLE cellSpacing=0 cellPadding=0 border=0>
<TBODY>

<TR>
<TD><img border="0" src='你的图片路径' width="125" height="135"></TD>
<TD><img border="0" src='你的图片路径' width="125" height="135"></TD>
<TD><img border="0" src='你的图片路径' width="125" height="135"></TD>
<TD><img border="0" src='你的图片路径' width="125" height="135"></TD>
<TD><img border="0" src='你的图片路径' width="125" height="135"></TD>
<TD><img border="0" src='你的图片路径' width="125" height="135"></TD>
<TD><img border="0" src='你的图片路径' width="125" height="135"></TD>
</TR></TBODY></TABLE></BODY></HTML>

===============================================

PAGE2,代码如下:

<IFRAME src="" frameBorder=0 width="" height="1"></IFRAME>
<IFRAME marginWidth=0 marginHeight=0
src="PAGE1" frameBorder=0
width="100%" scrolling=no height="135"></IFRAME>

============================
最后你在你所要的页面里调用PAGE2
就可以的,比如是asp的页面调用:程序如下:

<!--#include file="PAGE2"-->
就ok了!!!