谁能告诉我这是怎么做,解决问题的给50分

pingking 2002-06-14 08:59:54
http://www.tvnet.com.cn/这个网站的图片横向滚动是怎么用javascript实现的,请各位把源代码写出来。
...全文
47 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
pingking 2002-06-14
  • 打赏
  • 举报
回复
多些几位老大,我的邮箱是zw_jlcss@163.com,bencalie(Bencalie) 大哥拜托发一下,还有sjsky(sky)大哥你的代码我执行说有错误,最后 qisanyou(www.qisanyou.com)大哥感谢你提供的教程,我基本上已经明白了,再次谢谢各位老大。
sjsky 2002-06-14
  • 打赏
  • 举报
回复
<HTML><HEAD><TITLE>tvnet</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<SCRIPT language=JavaScript>
<!--//
var x = 0;
var y = 0;
var limdex = 1232;
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()', 8);

}
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>
<link rel="stylesheet" href="/tvnet.css" type="text/css">
<META content="MSHTML 5.50.4134.600" name=GENERATOR></HEAD>
<BODY leftMargin=0 topMargin=0 onload=scrollnow() marginwidth="0" marginheight="0" bgColor=#2d5983>
<TABLE cellSpacing=0 cellPadding=0 width=750 border=0>
<TR>
<TD width=315 bgColor=#2d5983></TD>
<TD width=120 align=center bgColor=#2d5983><A href="javascript:scrollit(x-150%20+%20y)"><IMG height=23 src="menu.files/img_btn_leftarrow.gif" width=36 border=0 name=img_btn_leftarrow></A><A href="javascript:stopscroll()"><IMG height=23 src="menu.files/img_btn_stop.gif" width=38 border=0 name=img_btn_stop alt="暂停滚动"></A><A href="javascript:scrollit(x+150%20+%20y)"><IMG height=23 src="menu.files/img_btn_rightarrow.gif" width=36 border=0 name=img_btn_rightarrow></A>
</TD>
<TD width=315 align=right bgColor=#2d5983><A HREF="http://www.tvnet.com.cn/" onmouseover="window.event.srcElement.title='中国影视网';return true" target=_top><span class=sans>Powered By TVnet.com.cn</FONT></span></A> </TD>
</TR>
</TABLE>
</BODY></HTML>
qisanyou 2002-06-14
  • 打赏
  • 举报
回复
看这个教程:

http://www.1studio.net/html/example/0009/0009.htm
希默软件 2002-06-14
  • 打赏
  • 举报
回复
留下Email,我发给你

87,994

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧