asp.net实现图片循环滚动
用的是datalist控件,代码如下,但只循环滚动一次就不动了,请高手帮忙看下,问题出来哪里!<script>varPicspeed=50demo2.innerHTML=...
用的是datalist控件,代码如下,但只循环滚动一次就不动了,请高手帮忙看下,问题出来哪里!
<script>
var Picspeed=50
demo2.innerHTML=demo1.innerHTML
function Marquee1(){
if(demo2.offsetWidth-demo.scrollLeft <=0)
demo.scrollLeft-=demo1.offsetWidth
else{
demo.scrollLeft++
}
}
var MyMar1=setInterval(Marquee1,Picspeed)
demo.onmouseover=function() {clearInterval(MyMar1)}
demo.onmouseout=function() {MyMar1=setInterval(Marquee1,Picspeed)}
</script>
我用的是vs2008,不支持 marquee 标记!! 展开
<script>
var Picspeed=50
demo2.innerHTML=demo1.innerHTML
function Marquee1(){
if(demo2.offsetWidth-demo.scrollLeft <=0)
demo.scrollLeft-=demo1.offsetWidth
else{
demo.scrollLeft++
}
}
var MyMar1=setInterval(Marquee1,Picspeed)
demo.onmouseover=function() {clearInterval(MyMar1)}
demo.onmouseout=function() {MyMar1=setInterval(Marquee1,Picspeed)}
</script>
我用的是vs2008,不支持 marquee 标记!! 展开
1个回答
2010-01-04
展开全部
<marquee onmouseover="this.stop()" onmouseout="this.start()" scrollamount="2" scrolldelay="0"
direction="left" atomicselection="true">
<div style="width: 100%; text-align: center;" align="left">
<asp:DataList ID="dl_Roll" runat="server" RepeatDirection="Horizontal" CellPadding="2">
<ItemTemplate>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr height="119" valign="top" align="center">
<td align="left" style="height:120px; padding-left: 20px;">
<asp:Image ID="ImgPic" runat="server" ToolTip='<%#Eval("PicText") %>' ImageUrl='<%#Eval("PicUrl") %>'
Height="120" Width="120px" style="cursor:Hand" />
</td>
</tr>
</table>
</ItemTemplate>
</asp:DataList>
</div>
</marquee>
direction="left" atomicselection="true">
<div style="width: 100%; text-align: center;" align="left">
<asp:DataList ID="dl_Roll" runat="server" RepeatDirection="Horizontal" CellPadding="2">
<ItemTemplate>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr height="119" valign="top" align="center">
<td align="left" style="height:120px; padding-left: 20px;">
<asp:Image ID="ImgPic" runat="server" ToolTip='<%#Eval("PicText") %>' ImageUrl='<%#Eval("PicUrl") %>'
Height="120" Width="120px" style="cursor:Hand" />
</td>
</tr>
</table>
</ItemTemplate>
</asp:DataList>
</div>
</marquee>
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询