Js图片循环滚动代码,支持停止,播放(调试通过)--推荐

<%@ Control Language="c#" AutoEventWireup="false" Codebehind="jiaoshifengcai.ascx.cs" Inherits="SchoolWeb.userControl.jiaoshifengcai" TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%>

  <TABLE id="Table1" cellSpacing="0" cellPadding="0" width="92%" align="center" border="0">
   <TR>
    <TD>
     <DIV id="demo" style="OVERFLOW: hidden; WIDTH: 785px; HEIGHT: 140px">
      <TABLE id="Table2" height="140" cellSpacing="0" cellPadding="0" width="785" border="0">
       <TR>
        <TD id="demo1" vAlign="middle">
         <TABLE id="Table3" height="140" cellSpacing="0" cellPadding="0" width="785" border="0">
          <TR>
           <TD>
            <DIV align="center">
             <TABLE id="Table4" cellSpacing="0" cellPadding="0" width="100%" border="0">
              <TR>
               <td>
                <asp:datalist id="DataList1" RepeatColumns="6" RepeatDirection="Horizontal" runat="server">
                 <ItemTemplate>
                  <TABLE cellSpacing="0" cellPadding="0" width="140" border="0">
                   <TR>
                    <TD>
                     <a href="picshow.aspx?id=<%# DataBinder.Eval(Container, "DataItem.id") %>" target="_blank"><img border="0" src="ManageWeb/smallimg/<%# DataBinder.Eval(Container, "DataItem.pic") %>" width="183" height="117"></a>
                    </TD>
                   </TR>
                   <TR>
                    <TD><div align="center"><a href="picshow.aspx?id=<%# DataBinder.Eval(Container, "DataItem.id") %>" target="_blank"><%# DataBinder.Eval(Container, "DataItem.title") %></a></div>
                    </TD>
                   </TR>
                   <TR>
                    <TD>
                    </TD>
                   </TR>
                  </TABLE>
                 </ItemTemplate>
                </asp:datalist>
               </td>
              </TR>
             </TABLE>
            </DIV>
           </TD>
          </TR>
         </TABLE>
        </TD>
        <TD id="demo2" vAlign="middle"></TD>
       </TR>
      </TABLE>
     <SCRIPT>
var speed=15
demo2.innerHTML=demo1.innerHTML
function Marquee1(){
if(demo2.offsetWidth-demo.scrollLeft<=0)
demo.scrollLeft-=demo1.offsetWidth
else{
demo.scrollLeft++
}
}
var MyMar1=setInterval(Marquee1,speed)
demo.onmouseover=function() {clearInterval(MyMar1)}
demo.onmouseout=function() {MyMar1=setInterval(Marquee1,speed)}
     </SCRIPT>
    </TD>
   </TR>
  </TABLE>

你可能感兴趣的:(server,function,table,asp,div,border)