<div id="demos" style="overflow: hidden;width: 100%;"> <div id="indemos" style="float: left;width: 800%; "> <div id="demos1" style="float: left"> <asp:Repeater ID="rpt_lylist" runat="server"> <ItemTemplate> <a href="javascript:void(0)" target="_blank" title='<%#Eval("title") %>'> [<%#Eval("title").ToString().Length > 16 ? Eval("title").ToString().Substring(0, 16) + ".." : Eval("title") %>] </a> </ItemTemplate> </asp:Repeater> </div> <div id="demos2" style="float: left;"></div> </div> </div> <script type="text/javascript"> var speed=30; var tabs=document.getElementById("demos"); var tabs1=document.getElementById("demos1"); var tabs2=document.getElementById("demos2"); tabs2.innerHTML=tabs1.innerHTML; function Marquee(){ if(tabs2.offsetWidth-tabs.scrollLeft<=0) tabs.scrollLeft-=tabs1.offsetWidth; else{ tabs.scrollLeft++; } };
var MyMar=setInterval(Marquee,speed); tabs.onmouseover=function() { clearInterval(MyMar); } tabs.onmouseout=function() {MyMar=setInterval(Marquee,speed);} </script>
1 回答
神不在的星期二
TA贡献1963条经验 获得超6个赞
悬浮上去,不停止滚动,把 tabs.onmouseover=function() { clearInterval(MyMar); } 这段话里面的 clearInterval(MyMar);注释掉即可, 修改为: tabs.onmouseover=function() {
//clearInterval(MyMar);
}
- 1 回答
- 0 关注
- 443 浏览
添加回答
举报
0/150
提交
取消