问题描述
从数据库里面读取新闻标题,实现跑马灯效果,最好给我实例,谢谢了。
解决方案
解决方案二:
先问你你是会读取还是会跑马?无非就是后台读取绑定到前台的隐藏域然后使用Jquery读取hidden的值settimeout给title赋值而已,....
解决方案三:
都不会,能不能给个代码
解决方案四:
这个写法不对,有办法改一下吗<%@PageLanguage="C#"AutoEventWireup="true"CodeFile="Default.aspx.cs"Inherits="_Default"%><!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><htmlxmlns="http://www.w3.org/1999/xhtml"><head><title>UntitledPage</title></head><styletype="text/css">.tablecc{height:50px;}</style><styletype="text/css">#demo{background:#FFF;overflow:hidden;border:1pxdashed#CCC;width:500px;height:20px;}#demoimg{border:3pxsolid#F2F2F2;height:80px;}#indemo{float:left;width:800%;}#demo1{float:left;}#demo2{float:left;}#divUpDown{width:200px;height:300px;overflow:hidden;}#divUpDownul{margin:0px;}#divUpDownli{list-style-type:none;margin:1px;}#divUpDownliimg{width:200px;}</style><body>向左滚动<formrunat="server"><divid="demo"><divid="indemo"><divid="demo1"><tablewidth="970"border="0"cellpadding="0"cellspacing="0"class="tablecc"><tr><td><asp:RepeaterID="Repeater1"runat="server"DataSourceID="SqlDataSource1"><ItemTemplate><%#DataBinder.Eval(Container.DataItem,"xw_name")%></ItemTemplate></asp:Repeater></td></tr></table></div><divid="demo2"></div></div></div><asp:SqlDataSourceID="SqlDataSource1"runat="server"ConnectionString="<%$ConnectionStrings:NewsNetwork_DataConnectionString%>"SelectCommand="SELECT*FROM[NewsAll]"></asp:SqlDataSource></form><spanid="sp1"></span><scripttype="text/javascript">varspeed=30;//数字越大速度越慢vardemo=document.getElementById("demo");vardemo1=document.getElementById("demo1");vardemo2=document.getElementById("demo2");varsp1=document.getElementById("sp1");demo2.innerHTML=demo1.innerHTML;functionMarquee(){if(demo.scrollLeft-demo1.offsetWidth>=0)demo.scrollLeft-=demo1.offsetWidth;else{demo.scrollLeft+=2;}}varMyMar=setInterval(Marquee,speed);demo.onmouseover=function(){clearInterval(MyMar)};demo.onmouseout=function(){MyMar=setInterval(Marquee,speed)};</script></body></html>
解决方案五:
tryit:
解决方案六:
没有现成的,这哪里是问题,这是伸手要代码