日期:2014-05-20 浏览次数:20755 次
<div id="ProductsShowInFPBody"> <div id="demo" style="overflow: hidden;"> <table> <tr> <td> <div id="demo1"> <asp:DataList ID="dstProduct" runat="server" RepeatDirection="Horizontal"> <ItemTemplate> <div id="ProductItem"> <div class="picFit" style="border: 1px solid #c6c4c4; overflow: hidden; width: 130px; height: 112px; padding: 0px; margin-top: 0px; text-align: center; vertical-align: middle"> <a href='ProductDetail.aspx?ID=<%#Eval("ID") %>&menuID=3&menuName=产品展示'> <img width="130" height="110" style="border: none; overflow: hidden;" src='<%#Eval("ProductImage") %>' alt='<%#Eval("ProductName") %>' /></a> </div> <div style="text-align: center; margin-top: 10px; width: 130px; height: 30px;"> <a href='ProductDetail.aspx?ID=<%#Eval("ID") %>&menuID=3&menuName=产品展示' class="title"> <%#Eval("ProductName") %></a> </a> </div> </div> </ItemTemplate> </asp:DataList> </div> </td> <td> <div id="demo2"> </div> </td> </tr> </table> </div> </div> <script type="text/javascript"> var speed = 30; var demo = $("div#demo"); var demo1 = $("div#demo1"); var demo2 = $("div#demo2"); demo2.html(demo1.html()); function Marquee() { if (demo.scrollLeft() >= demo1.width()) demo.scrollLeft(0); else { demo.scrollLeft(demo.scrollLeft() + 1); } } var MyMar = setInterval(Marquee, speed) demo.mouseover(function () { clearInterval(MyMar); }) demo.mouseout(function () { MyMar = setInterval(Marquee, speed); }) </script>