求一图片滚动效果,要求:图片分多行显示,每滚一行,停顿几秒后,接着滚动下面的图片行。

 我来答
琳子么PEAT
2014-04-29 · 超过72用户采纳过TA的回答
知道答主
回答量:117
采纳率:80%
帮助的人:67.6万
展开全部
是这个效果吧,复制到HTML文件里就能用。 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" " http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd"> <!-- saved from url=(0040) http://news.qq.com/a/20080702/001108.htm --> <HTML><HEAD><TITLE>单行多条信息滚动</TITLE> <SCRIPT language=javascript>function T(n){document.getElementById("ArticleCnt").style.fontSize=n+"px";}</SCRIPT> <BODY> <SCRIPT> function srcMarquee(){ this.ID = document.getElementById(arguments[0]); if(!this.ID){this.ID = -1;return;} this.Direction = this.Width = this.Height = this.DelayTime = this.WaitTime = this.Correct = this.CTL = this.StartID = this.Stop = this.MouseOver = 0; this.Step = 1; this.Timer = 30; this.DirectionArray = {"top":0 , "bottom":1 , "left":2 , "right":3}; if(typeof arguments[1] == "number")this.Direction = arguments[1]; if(typeof arguments[2] == "number")this.Step = arguments[2]; if(typeof arguments[3] == "number")this.Width = arguments[3]; if(typeof arguments[4] == "number")this.Height = arguments[4]; if(typeof arguments[5] == "number")this.Timer = arguments[5]; if(typeof arguments[6] == "number")this.DelayTime = arguments[6]; if(typeof arguments[7] == "number")this.WaitTime = arguments[7]; if(typeof arguments[8] == "number")this.ScrollStep = arguments[8] this.ID.style.overflow = this.ID.style.overflowX = this.ID.style.overflowY = "hidden"; this.ID.noWrap = true; this.IsNotOpera = (navigator.userAgent.toLowerCase().indexOf("opera") == -1); if(arguments.length >= 7)this.Start(); } srcMarquee.prototype.Start = function(){ if(this.ID == -1)return; if(this.WaitTime < 800)this.WaitTime = 800; if(this.Timer < 20)this.Timer = 20; if(this.Width == 0)this.Width = parseInt(this.ID.style.width); if(this.Height == 0)this.Height = parseInt(this.ID.style.height); if(typeof this.Direction == "string")this.Direction = this.DirectionArray[this.Direction.toString().toLowerCase()]; this.HalfWidth = Math.round(this.Width / 2); this.BakStep = this.Step; this.ID.style.width = this.Width; this.ID.style.height = this.Height; if(typeof this.ScrollStep != "number")this.ScrollStep = this.Direction > 1 ? this.Width : this.Height; var msobj = this; var timer = this.Timer; var delaytime = this.DelayTime; var waittime = this.WaitTime; msobj.StartID = function(){msobj.Scroll()} msobj.Continue = function(){ if(msobj.MouseOver == 1){ setTimeout(msobj.Continue,delaytime); } else{ clearInterval(msobj.TimerID); msobj.CTL = msobj.Stop = 0; msobj.TimerID = setInterval(msobj.StartID,timer); } } msobj.Pause = function(){ msobj.Stop = 1; clearInterval(msobj.TimerID); setTimeout(msobj.Continue,delaytime); } msobj.Begin = function(){ msobj.ClientScroll = msobj.Direction > 1 ? msobj.ID.scrollWidth : msobj.ID.scrollHeight; if((msobj.Direction <= 1 && msobj.ClientScroll <msobj.Height) || (msobj.Direction > 1 && msobj.ClientScroll <msobj.Width))return; msobj.ID.innerHTML += msobj.ID.innerHTML; msobj.TimerID = setInterval(msobj.StartID,timer); if(msobj.ScrollStep < 0)return; msobj.ID.onmousemove = function(event){ if(msobj.ScrollStep == 0 && msobj.Direction > 1){ var event = event || window.event; if(window.event){ if(msobj.IsNotOpera){msobj.EventLeft = event.srcElement.id == msobj.ID.id ? event.offsetX - msobj.ID.scrollLeft : event.srcElement.offsetLeft - msobj.ID.scrollLeft + event.offsetX;} else{msobj.ScrollStep = null;return;} } else{msobj.EventLeft = event.layerX - msobj.ID.scrollLeft;} msobj.Direction = msobj.EventLeft > msobj.HalfWidth ? 3 : 2; msobj.AbsCenter = Math.abs(msobj.HalfWidth - msobj.EventLeft); msobj.Step = Math.round(msobj.AbsCenter * (msobj.BakStep*2) / msobj.HalfWidth); } } msobj.ID.onmouseover = function(){ if(msobj.ScrollStep == 0)return; msobj.MouseOver = 1; clearInterval(msobj.TimerID); } msobj.ID.onmouseout = function(){ if(msobj.ScrollStep == 0){ if(msobj.Step == 0)msobj.Step = 1; return; } msobj.MouseOver = 0; if(msobj.Stop == 0){ clearInterval(msobj.TimerID); msobj.TimerID = setInterval(msobj.StartID,timer); }}} setTimeout(msobj.Begin,waittime); } srcMarquee.prototype.Scroll = function(){ switch(this.Direction){ case 0: this.CTL += this.Step; if(this.CTL >= this.ScrollStep && this.DelayTime > 0){ this.ID.scrollTop += this.ScrollStep + this.Step - this.CTL; this.Pause(); return; } else{ if(this.ID.scrollTop >= this.ClientScroll){this.ID.scrollTop -= this.ClientScroll;} this.ID.scrollTop += this.Step; } break; case 1: this.CTL += this.Step; if(this.CTL >= this.ScrollStep && this.DelayTime > 0){ this.ID.scrollTop -= this.ScrollStep + this.Step - this.CTL; this.Pause(); return; } else{ if(this.ID.scrollTop <= 0){this.ID.scrollTop += this.ClientScroll;} this.ID.scrollTop -= this.Step; } break; case 2: this.CTL += this.Step; if(this.CTL >= this.ScrollStep && this.DelayTime > 0){ this.ID.scrollLeft += this.ScrollStep + this.Step - this.CTL; this.Pause(); return; } else{ if(this.ID.scrollLeft >= this.ClientScroll){this.ID.scrollLeft -= this.ClientScroll;} this.ID.scrollLeft += this.Step; } break; case 3: this.CTL += this.Step; if(this.CTL >= this.ScrollStep && this.DelayTime > 0){ this.ID.scrollLeft -= this.ScrollStep + this.Step - this.CTL; this.Pause(); return; } else{ if(this.ID.scrollLeft <= 0){this.ID.scrollLeft += this.ClientScroll;} this.ID.scrollLeft -= this.Step; } break; } } </SCRIPT> <STYLE>#nav { MARGIN: 7px auto 0px; HEIGHT: 117px } #nav #hotnews { BORDER-BOTTOM-WIDTH: 0px; HEIGHT: 89px } #Scroll { CLEAR: both; BORDER-RIGHT: #cdc9ca 1px solid; BORDER-TOP: #cdc9ca 1px solid; PADDING-LEFT: 100px; FONT-SIZE: 12px; MARGIN: 0px auto; BORDER-LEFT: #cdc9ca 1px solid; WIDTH: 808px; COLOR: #c2130e; LINE-HEIGHT: 27px; BORDER-BOTTOM: #cdc9ca 1px solid; HEIGHT: 130px; TEXT-ALIGN: left } #Scroll A { PADDING-RIGHT: 10px; PADDING-LEFT: 10px; no-repeat 0px 0px; COLOR: #000; MARGIN-RIGHT: 5px; TEXT-DECORATION: none } #Scroll A.s_end { PADDING-RIGHT: 0px; MARGIN-LEFT: 8px } </STYLE> <DIV id=Scroll> <DIV id=ScrollMe style=" HEIGHT: 200px; padding-top:5px;"> <A href="#" target=_blank><img src=" http://www.wj120.com/images/ry4.gif" /></A> <A href="#" target=_blank><img src=" http://www.wj120.com/images/ry4.gif" /></A> <A href="#" target=_blank><img src=" http://www.wj120.com/images/ry4.gif" /></A> <A href="#" target=_blank><img src=" http://www.wj120.com/images/ry4.gif" /></A> <A href="#" target=_blank><img src=" http://www.wj120.com/images/ry4.gif" /></A> <A href="#" target=_blank><img src=" http://www.wj120.com/images/ry4.gif" /></A> <A href="#" target=_blank><img src=" http://www.wj120.com/images/ry4.gif" /></A> <A class=s_end href="#" target=_blank><img src=" http://www.wj120.com/images/ry4.gif" /></A> <BR><A href="#" target=_blank><img src=" http://www.wj120.com/images/ry4.gif" /></A> <A href="#" target=_blank><img src=" http://www.wj120.com/images/ry4.gif" /></A> <A href="#" target=_blank><img src=" http://www.wj120.com/images/ry4.gif" /></A> <A href="#" target=_blank><img src=" http://www.wj120.com/images/ry4.gif" /></A> <A class=s_end href="#" target=_blank><img src=" http://www.wj120.com/images/ry4.gif" /></A> <BR> </DIV></DIV> <SCRIPT>new srcMarquee("ScrollMe",0,1,808,110,30,3000,3000,110)</SCRIPT> </DIV></BODY></HTML>
仁厚且痛快的小饼干933
2014-04-28 · TA获得超过239个赞
知道答主
回答量:181
采纳率:100%
帮助的人:130万
展开全部
<div id=img> <a href="#"><img src="5.jpg" border=0 width=100 height=50></a><BR> <a href="#"><img src="7.jpg" border=0 width=100 height=50></a><BR> <a href="#"><img src="2.jpg" border=0 width=100 height=50></a><BR> </div> <SCRIPT language=JavaScript> <!-- marHeight=50; // 设定高度 stopscroll=false; with(img) { style.height=marHeight; style.overflowX="visible"; style.overflowY="hidden"; noWrap=true; onmouseover=new Function("stopscroll=true"); // 鼠标悬停停止滚动 onmouseout=new Function("stopscroll=false"); // 鼠标离开开始滚动 } preTop=0; currentTop=50; // 设定滚动高度 stoptime=0; img.innerHTML += img.innerHTML; // 赋值 function scrollimg() { img.scrollTop=0; setInterval("scrollUp()",20); // 设定图片滚动时间 } function scrollUp() { if(stopscroll==true) return; currentTop+=1; if(currentTop>50) // 判断滚动高度 { stoptime+=1; currentTop-=1; if(stoptime==30) // 设定图片停留时间 { currentTop=0; stoptime=0; } } else { preTop=img.scrollTop; img.scrollTop+=1; if(preTop==img.scrollTop) { img.scrollTop=0; img.scrollTop+=1; } } } scrollimg(); //--> </script> 改下图片就行好了
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
辛德瑞拉o03
2014-04-29 · 超过55用户采纳过TA的回答
知道答主
回答量:110
采纳率:100%
帮助的人:102万
展开全部
垂直滚动,鼠标移动上去停止滚动,IE。FF测试通过: <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <meta name="Copyright" content="感情用饰 http://www.huer.net.cn/" /> <meta name="keywords" content="JS代码,图片特效,JS广告代码,JS特效代码" /> <meta name="description" content="此代码内容为垂直无接缝图片滚动代码,属于站长常用代码" /> <title>垂直无接缝图片滚动代码_感情用饰 阿虎</title> <style type="text/css"> <!-- TD {FONT-SIZE: 12px;} </style> </head> <body> <div id=link_logo style="OVERFLOW: hidden; WIDTH: 190px; HEIGHT: 235px"> <div id=link_logo1 style="OVERFLOW: hidden"> <table cellspacing=0 cellpadding=0 width=180 border=0> <tbody> <tr> <td valign=top align=middle height=33><table cellspacing=0 cellpadding=2 border=0> <tbody> <tr> <td align=middle><a href=" http://www.huer.net.cn/" target=_blank><img src="images/lanrentuku.gif" alt="" width="88" height="31" border=0></a><a href=" http://www.huer.net.cn/" target=_blank></a></td> </tr> </tbody> </table></td> <td valign=top align=middle height=33><table cellspacing=0 cellpadding=2 border=0> <tbody> <tr> <td align=middle><a href=" http://www.huer.net.cn/" target=_blank><img src="images/lanrentuku.gif" alt="" width="88" height="31" border=0></a></td> </tr> </tbody> </table></td> </tr> <tr> <td valign=top align=middle height=33><table cellspacing=0 cellpadding=2 border=0> <tbody> <tr> <td align=middle><a href=" http://www.huer.net.cn/" target=_blank><img src="images/lanrentuku.gif" alt="" width="88" height="31" border=0></a><a href=" http://www.huer.net.cn/" target=_blank></a></td> </tr> </tbody> </table></td> <td valign=top align=middle height=33><table cellspacing=0 cellpadding=2 border=0> <tbody> <tr> <td align=middle><a href=" http://www.huer.net.cn/" target=_blank><img src="images/lanrentuku.gif" alt="" width="88" height="31" border=0></a></td> </tr> </tbody> </table></td> </tr> <tr> <td valign=top align=middle height=33><table cellspacing=0 cellpadding=2 border=0> <tbody> <tr> <td align=middle><a href=" http://www.huer.net.cn/" target=_blank><img src="images/lanrentuku.gif" alt="" width="88" height="31" border=0></a><a href=" http://www.chinasspp.com/" target=_blank></a></td> </tr> </tbody> </table></td> <td valign=top align=middle height=33><table cellspacing=0 cellpadding=2 border=0> <tbody> <tr> <td align=middle><a href=" http://www.huer.net.cn/"
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
小P孩0105
2014-04-29 · 超过55用户采纳过TA的回答
知道答主
回答量:163
采纳率:50%
帮助的人:126万
展开全部
是不是这个效果? 这个是我自己用的,基本兼容当前所有浏览器吧,不合适再自己找找,上面很多图片滚动特效 http://www.zzjs.net/post/2543.html
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 更多回答(2)
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式