跪求处理图片无间隙滚动....
发布网友
发布时间:2022-04-24 16:42
我来回答
共2个回答
热心网友
时间:2022-04-24 18:11
<!--左滚动-->
<div id="demo" style="overflow:hidden;width:600px; margin-top:5px; margin-left:10px; ">
<table align="left" cellpadding="0" border="0"><tr><td id="demo1" valign="top">
<table width="730" border="0" cellpadding="0" cellspacing="0">
<tr>
<!--产品展示-->
<td>
<table width="200" border="0" cellspacing="0" cellpadding="0" style=" float:left; border:#FF0000 solid 1px; margin-top:5px; margin-bottom:5px; margin-left:8px;" >
<tr>
<td>可放图片</td>
</tr>
</table>
<table width="200" border="0" cellspacing="0" cellpadding="0" style=" float:left; border:#FF0000 solid 1px; margin-top:5px; margin-bottom:5px; margin-left:8px;" >
<tr>
<td>可放图片</td>
</tr>
</table>
<table width="200" border="0" cellspacing="0" cellpadding="0" style=" float:left; border:#FF0000 solid 1px; margin-top:5px; margin-bottom:5px; margin-left:8px;" >
<tr>
<td>可放图片</td>
</tr>
</table>
</td>
<!--产品展示_end-->
</tr>
</table>
</td><td id="demo2" valign="top"></td></tr></table></div>
<script language="javascript" type="text/javascript">
var LeftMyMar;
var MyMar;
var speed=30;
function MarqueeLeft()
{
clearInterval(MyMar)
demo2.innerHTML=demo1.innerHTML
//向左走
function Marquee(){
if(demo2.offsetWidth-demo.scrollLeft<=0)
demo.scrollLeft-=demo1.offsetWidth
else{
demo.scrollLeft++
}
}
LeftMyMar=setInterval(Marquee,speed)
demo.onmouseover=function() {clearInterval(LeftMyMar)}
demo.onmouseout=function() {LeftMyMar=setInterval(Marquee,speed)}
}
MarqueeLeft();
</script>
<!--左滚动_end-->
百度上找 人仁建站网,
看人仁建站网-网页设计_源码编程
在js里面有
热心网友
时间:2022-04-24 19:29
<!--实现图片无间隙滚动效果-->
<div id="demo" align="center" style="overflow:hidden; height: 170px; width: 1037px; border-width: 0px 0px 0px 0px;">
<table border="0" cellpadding="0" cellspacing="0" >
<tr>
<td id="demo1">
<!--这里是从数据库动态取出图片-->
<asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate><a href='<%# Eval("Movieid","MovieDetail.aspx?mid={0}") %>'><img alt='<%# Eval("Moviename") %>' src='<%# Eval("Movieimage","myimages/{0}") %>' height="170px"; width="160px";></a></ItemTemplate>
</asp:Repeater>
</td>
<td id="demo2">
</td>
</tr>
</table>
</div>
上面应该特别注意的是:在<div></div>中如果你也不小多打了一个空格,图片就不能正常的显示,所以特别要注意<div></div>中不能有任何空格!!!
试试吧!可以帮你解决图片无间隙滚动效果!
参考资料:回忆