http://community.csdn.net/Expert/topic/3301/3301827.xml?temp=.8907282
这个是asp版的 小弟新学php 还没有能力修改成php的

解决方案 »

  1.   

    数组都是用JS控制的啊,那里面可以用php吗
      

  2.   

    在服务端生成JS不就能用PHP控制了嘛。。看这个,,
    http://blog.csdn.net/twt326/archive/2004/11/16/183571.aspx
      

  3.   

    <!--滚动图片--><SCRIPT language=Javascript>
    document.write('<table align=center width=530 border=0 cellpadding=0 cellspacing=0 style=BORDER-LEFT: #cccccc 1px solid;BORDER-RIGHT: #cccccc 1px solid>');document.write('    <tr> ');document.write('      <td width=530 height=90 align=center class=border01 bgcolor=#FFFFFF>');document.write('      <div id=demo style=overflow:hidden;width:530;align=center>');document.write('        <table border=0 align=center cellpadding=1 cellspacing=1 cellspace=0 >');document.write('          <tr>');document.write('           <td valign=top bgcolor=ffffff id=marquePic1> ');
    ////////////////////////////////
    //这一部分用程序读数据库就行了
    document.write("<table width=100%> <tr><td align=center><a href=commendpicweb/product/13.html  title='图片名'      target=_blank><img src=commendpic/1.jpg width=80 height=60 style='border: 1px solid #000000' alt=图片名></a>&nbsp;<BR>图片名</td><td align=center><a href=commendpicweb/product/12.html  title='fsdf'      target=_blank><img src=commendpic/2.jpg width=80 height=60 style='border: 1px solid #000000' alt=fsdf></a>&nbsp;<BR>图片名</td><td align=center><a href=commendpicweb/product/11.html  title='图片名'      target=_blank><img src=commendpic/3.jpg width=80 height=60 style='border: 1px solid #000000' alt=图片名></a>&nbsp;<BR>图片名</td><td align=center><a href=commendpicweb/product/10.html  title='图片名'      target=_blank><img src=commendpic/4.jpg width=80 height=60 style='border: 1px solid #000000' alt=图片名></a>&nbsp;<BR>图片名</td><td align=center><a href=commendpicweb/product/9.html  title='图片名'      target=_blank><img src=commendpic/5.jpg width=80 height=60 style='border: 1px solid #000000' alt=图片名></a>&nbsp;<BR>图片名</td><td align=center><a href=commendpicweb/product/8.html  title='图片名'      target=_blank><img src=commendpic/1.jpg width=80 height=60 style='border: 1px solid #000000' alt=图片名></a>&nbsp;<BR>图片名</td><td align=center><a href=commendpicweb/product/7.html  title='图片名'      target=_blank><img src=commendpic/2.jpg width=80 height=60 style='border: 1px solid #000000' alt=图片名></a>&nbsp;<BR>图片名</td><td align=center><a href=commendpicweb/product/6.html  title='图片名'      target=_blank><img src=commendpic/3.jpg width=80 height=60 style='border: 1px solid #000000' alt=图片名></a>&nbsp;<BR>图片名</td></tr></table>");
    ///////////////////////////////document.write('           </td>');document.write('    <td id=marquePic2 valign=top></td>');document.write('         </tr>');document.write('       </table>');document.write('      </div>');document.write('      </td>');document.write('    </tr>');document.write('  </table>');
    var speed=30
    marquePic2.innerHTML=marquePic1.innerHTML
    function Marquee(){
    if(demo.scrollLeft>=marquePic1.scrollWidth){
    demo.scrollLeft=0
    }else{
    demo.scrollLeft++
    }
    }
    var MyMar=setInterval(Marquee,speed)
    demo.onmouseover=function() {clearInterval(MyMar)}
    demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}</SCRIPT>
    <!--滚动图片-->
      

  4.   

    给你看看这个,简单易行,代码又不多。
    http://blog.csdn.net/kingerq/archive/2004/11/12/178524.aspx
      

  5.   

    twt326(天地小子) ;
       还在吗?
      

  6.   

    你可以直接COPY别人网站上有关图片滚动的JS代码啊???
      

  7.   

    kingerq(多菜鸟) 兄的和我的代码一样哦。。不过,,声明,,我可不是抄的哦。。
    有一次在一个电信(哪里的不记得了)网站上看到了向左滚动的,,我就DOWN下来,然后改了一个向上的,一个向下的,和一个向右的于是,就发上来了。
      

  8.   

    <!--数据库连接文件-->
    <!--#include file="admin/inc/conn.asp"-->
    <%
    '执行存储过程读出来图片路径和名称
             Set Rs_logo=Conn.Execute("Get_AD_Top10")
    If Rs_logo.Eof and Rs_logo.Bof then
    Call noMessage()
    Else
    %>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>滚动图片</title>
    <style type="text/css">
    td,p {font-size:12px}
    A IMG {border:1px solid #000}
    body {
    margin-left: 0px;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 0px;
    }
    </style>
    <body bgcolor=#ffffff onselectstart='return false' oncontextmenu='return false'>
        <!--专题图片精选 begin-->
        <!--滚动图片资料 begin-->
    <table width="100%" border=0 cellpadding=0 cellspacing=0>
    <tr><td height=74 style="border:0px solid #ff0000;padding-top:1px" align=left valign=top>                                             
    <table width="100%" border=0 cellpadding=0 cellspacing=0>                                                                                                          
    <tr><td width="100%" height="73">                                                                                                                                                                                         
     <div id=demo style=overflow:hidden;height:126;width:778;color:#ffffff>
     <table align=left cellpadding=0 cellspace=0 border=0><tr><td id=demo1 valign=top>
    <table border=0 cellpadding=0 cellspacing=0>
    <tr>
              <%Do While Not Rs_logo.Eof%>
      <td>
    <!--如果isFlash字段为真显示flash-->
                               <%If Rs_logo("IsFlash")=true then%>
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="108" height="37">
    <param name="movie" value="Admin/AD/<%=Rs_logo("ImgUrl")%>">
    <param name="quality" value="high">
    <embed src="Admin/AD/<%=Rs_logo("ImgUrl")%>" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="108" height="37"></embed>
    </object>
    <%Else%>
    <a href="<%=Rs_logo("SiteUrl")%>" target="_blank"><img src="Admin/AD/<%=Rs_logo("ImgUrl")%>" border="0" alt="<%=Rs_logo("SiteName")%>" width="108" height="37"></a><br>
          <%End IF%>
      <center>
            </center></td>
              <td width=10></td>
         <%
    Rs_logo.Movenext
    Loop
    End if
    Rs_logo.close
    Set Rs_logo=nothing
    %>      
    </tr>
    </table>
    </td><td id=demo2 valign=top></td></tr></table></div>
     <script src="inc/scrollpic.js"></script>
    </td></tr>                                                                                                                                                                                        
    </table>                                                                                                                                                                                                                              
    </td></tr>                                                                                                                                                                                                                                    
    </table>       
    <!--滚动图片资料 end-->
    <!--专题图片精选 end-->
    <noscript>
    </noscript>
    </body></html>scrollpic.js如下 var speed=10//速度数值越大速度越慢
      demo2.innerHTML=demo1.innerHTML
      function Marquee(){
      if(demo2.offsetWidth-demo.scrollLeft<=0)
      demo.scrollLeft-=demo1.offsetWidth
      else{
      demo.scrollLeft++
      }
      }
      var MyMar=setInterval(Marquee,speed)
      demo.onmouseover=function() {clearInterval(MyMar)}
      demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
    然后调用的时候 Ifame包含第一个ASP文件就可以了。
      

  9.   

    php同理 只需要把我写的第一个文件 读数据库、还有循环部分用php代替