JS 图片滚动怎么做 求代码 5
2个回答
展开全部
<SCRIPT language=JavaScript>
function marquee1()
{
document.write("<div style='width:100%;overflow:hidden;' id=marquee onmouseover=clearInterval(repeat) onmouseout=repeat=setInterval(scrollMarquee,1)>")
}
function marquee2()
{
document.write("</div>")
marquee.childNodes[0].align='left';
if(marquee.childNodes[0].offsetWidth>marquee.offsetWidth) {
marquee.appendChild(marquee.childNodes[0].cloneNode(true));
}
else {
for(var i=0;i<Math.round(marquee.offsetWidth/marquee.childNodes[0].offsetWidth)+1;i++) {
marquee.appendChild(marquee.childNodes[0].cloneNode(true));
}
}
repeat=setInterval(scrollMarquee,1);
}
function scrollMarquee() {
if(marquee.scrollLeft<marquee.childNodes[0].offsetWidth)
marquee.scrollLeft++;
else
marquee.scrollLeft=0;
}
</SCRIPT>
<SCRIPT language=JavaScript>marquee1();</SCRIPT>
<table width="300" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><a href=/picture/00000133.asp target=_blank ><img border=0 height=67 src="http://www.51sql.com/articleimg/gundong1.jpg" alt="图片8" ></a></td>
<td><a href=/picture/00000132.asp target=_blank ><img border=0 height=67 src="http://www.51sql.com/articleimg/gundong2.jpg" alt="图片7" ></a></td>
<td><a href=/picture/00000131.asp target=_blank ><img border=0 height=67 src="http://www.51sql.com/articleimg/gundong3.jpg" alt="图片6" ></a></td>
<td><a href=/picture/00000130.asp target=_blank ><img border=0 height=67 src="http://www.51sql.com/articleimg/gundong4.gif" alt="图片5" ></a></td>
<td><a href=/picture/00000129.asp target=_blank ><img border=0 height=67 src="http://www.51sql.com/articleimg/gundong4.gif" alt="图片4" ></a></td>
<td><a href=/picture/00000128.asp target=_blank ><img border=0 height=67 src="http://www.51sql.com/articleimg/gundong3.jpg" alt="图片3" ></a></td>
<td><a href=/picture/00000127.asp target=_blank ><img border=0 height=67 src="http://www.51sql.com/articleimg/gundong2.jpg" alt="图片2" ></a></td>
<td><a href=/picture/00000126.asp target=_blank ><img border=0 height=67 src="http://www.51sql.com/articleimg/gundong1.jpg" alt="图片1" ></a></td>
</tr>
</table>
<SCRIPT language=JavaScript>marquee2(); </SCRIPT>
function marquee1()
{
document.write("<div style='width:100%;overflow:hidden;' id=marquee onmouseover=clearInterval(repeat) onmouseout=repeat=setInterval(scrollMarquee,1)>")
}
function marquee2()
{
document.write("</div>")
marquee.childNodes[0].align='left';
if(marquee.childNodes[0].offsetWidth>marquee.offsetWidth) {
marquee.appendChild(marquee.childNodes[0].cloneNode(true));
}
else {
for(var i=0;i<Math.round(marquee.offsetWidth/marquee.childNodes[0].offsetWidth)+1;i++) {
marquee.appendChild(marquee.childNodes[0].cloneNode(true));
}
}
repeat=setInterval(scrollMarquee,1);
}
function scrollMarquee() {
if(marquee.scrollLeft<marquee.childNodes[0].offsetWidth)
marquee.scrollLeft++;
else
marquee.scrollLeft=0;
}
</SCRIPT>
<SCRIPT language=JavaScript>marquee1();</SCRIPT>
<table width="300" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><a href=/picture/00000133.asp target=_blank ><img border=0 height=67 src="http://www.51sql.com/articleimg/gundong1.jpg" alt="图片8" ></a></td>
<td><a href=/picture/00000132.asp target=_blank ><img border=0 height=67 src="http://www.51sql.com/articleimg/gundong2.jpg" alt="图片7" ></a></td>
<td><a href=/picture/00000131.asp target=_blank ><img border=0 height=67 src="http://www.51sql.com/articleimg/gundong3.jpg" alt="图片6" ></a></td>
<td><a href=/picture/00000130.asp target=_blank ><img border=0 height=67 src="http://www.51sql.com/articleimg/gundong4.gif" alt="图片5" ></a></td>
<td><a href=/picture/00000129.asp target=_blank ><img border=0 height=67 src="http://www.51sql.com/articleimg/gundong4.gif" alt="图片4" ></a></td>
<td><a href=/picture/00000128.asp target=_blank ><img border=0 height=67 src="http://www.51sql.com/articleimg/gundong3.jpg" alt="图片3" ></a></td>
<td><a href=/picture/00000127.asp target=_blank ><img border=0 height=67 src="http://www.51sql.com/articleimg/gundong2.jpg" alt="图片2" ></a></td>
<td><a href=/picture/00000126.asp target=_blank ><img border=0 height=67 src="http://www.51sql.com/articleimg/gundong1.jpg" alt="图片1" ></a></td>
</tr>
</table>
<SCRIPT language=JavaScript>marquee2(); </SCRIPT>
2014-06-07
展开全部
这个不难,网上你搜一下网页图片特效,这样的代码很多的。希望有帮到你!
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询