如何让网页中的图片滚动起来
下面是一段网站首页代码,我想让里面的产品展示图片滚动起来,就是向左滚动的那种,我看了很多回答,还是不会,麻烦哪位高手帮帮忙,直接帮我改了。谢谢。<!--产品展示--><T...
下面是一段网站首页代码,我想让里面的产品展示图片滚动起来,就是向左滚动的那种,我看了很多回答,还是不会,麻烦哪位高手帮帮忙,直接帮我改了。谢谢。
<!-- 产品展示 -->
<TR>
<TD>
<TABLE cellSpacing=0 cellPadding=0 align="center" class='MC_Pt_Title'>
<TR>
<TD class='MC_Pt_TD1'><IMG src='../img/1x1_pix.gif' width=3 height=1></TD>
<TD class='MC_Pt_TD2'><IMG src='../img/1x1_pix.gif' width=3 height=1></TD>
<TD class='MC_Pt_TD3'><SPAN class=Glow>产品展示 </SPAN></TD>
<TD class='HomeMC_Pt_TD5'><a href="Product.asp" title="更多产品展示..."><IMG src='../img/1x1_pix.gif' width=52 height=23 border=0></a></TD>
</TR>
</TABLE>
</TD>
</TR>
<TR>
<TD align="center">
<table width="100%" border="0" cellspacing="1" cellpadding="0" class=main_tdbg>
<tr>
<TD align="center"><% call ProductZY() %></TD>
</tr>
</table>
</TD>
</TR>
<!-- 产品展示END -->
我上传的文件都是JPG的 展开
<!-- 产品展示 -->
<TR>
<TD>
<TABLE cellSpacing=0 cellPadding=0 align="center" class='MC_Pt_Title'>
<TR>
<TD class='MC_Pt_TD1'><IMG src='../img/1x1_pix.gif' width=3 height=1></TD>
<TD class='MC_Pt_TD2'><IMG src='../img/1x1_pix.gif' width=3 height=1></TD>
<TD class='MC_Pt_TD3'><SPAN class=Glow>产品展示 </SPAN></TD>
<TD class='HomeMC_Pt_TD5'><a href="Product.asp" title="更多产品展示..."><IMG src='../img/1x1_pix.gif' width=52 height=23 border=0></a></TD>
</TR>
</TABLE>
</TD>
</TR>
<TR>
<TD align="center">
<table width="100%" border="0" cellspacing="1" cellpadding="0" class=main_tdbg>
<tr>
<TD align="center"><% call ProductZY() %></TD>
</tr>
</table>
</TD>
</TR>
<!-- 产品展示END -->
我上传的文件都是JPG的 展开
展开全部
<div align='center' id='demo' style='overflow:hidden;height:130px;width:686px;'>
<table align='center' cellpadding='0' cellspace='0' border='0'>
<tr>
<td width="287" valign='top' id='demo1'>
<table width='100%' cellpadding='0' cellspacing='0' border='0' align='center'>
<tr valign='top'>
<TD class='MC_Pt_TD1'><IMG src='../img/1x1_pix.gif' width=3 height=1></TD>
<TD class='MC_Pt_TD2'><IMG src='../img/1x1_pix.gif' width=3 height=1></TD>
<TD class='MC_Pt_TD3'><SPAN class=Glow>产品展示 </SPAN></TD>
<TD class='HomeMC_Pt_TD5'><a href="Product.asp" title="更多产品展示..."><IMG src='../img/1x1_pix.gif' width=52 height=23 border=0></a></TD> '此处图片数量要比较多才能滚动
</tr>
</table>
</td>
<td width="12" valign=top id=demo2></td>
</tr>
</table>
</div>
<script>
var speed=15
demo2.innerHTML=demo1.innerHTML
function Marquee1(){
if(demo2.offsetWidth-demo.scrollLeft<=0)
demo.scrollLeft-=demo1.offsetWidth
else{
demo.scrollLeft++
}
}
var MyMar1=setInterval(Marquee1,speed)
demo.onmouseover=function() {clearInterval(MyMar1)}
demo.onmouseout=function() {MyMar1=setInterval(Marquee1,speed)}
</script>
<table align='center' cellpadding='0' cellspace='0' border='0'>
<tr>
<td width="287" valign='top' id='demo1'>
<table width='100%' cellpadding='0' cellspacing='0' border='0' align='center'>
<tr valign='top'>
<TD class='MC_Pt_TD1'><IMG src='../img/1x1_pix.gif' width=3 height=1></TD>
<TD class='MC_Pt_TD2'><IMG src='../img/1x1_pix.gif' width=3 height=1></TD>
<TD class='MC_Pt_TD3'><SPAN class=Glow>产品展示 </SPAN></TD>
<TD class='HomeMC_Pt_TD5'><a href="Product.asp" title="更多产品展示..."><IMG src='../img/1x1_pix.gif' width=52 height=23 border=0></a></TD> '此处图片数量要比较多才能滚动
</tr>
</table>
</td>
<td width="12" valign=top id=demo2></td>
</tr>
</table>
</div>
<script>
var speed=15
demo2.innerHTML=demo1.innerHTML
function Marquee1(){
if(demo2.offsetWidth-demo.scrollLeft<=0)
demo.scrollLeft-=demo1.offsetWidth
else{
demo.scrollLeft++
}
}
var MyMar1=setInterval(Marquee1,speed)
demo.onmouseover=function() {clearInterval(MyMar1)}
demo.onmouseout=function() {MyMar1=setInterval(Marquee1,speed)}
</script>
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |