注册 登录
编程论坛 ASP技术论坛

如何实现商品滚动的效果

bajun 发布于 2008-10-06 09:21, 1063 次点击
<MARQUEE scrollAmount=1 scrollDelay=50 width=460 height="130" direction="up" align="center" onMouseOver="this.stop()" onMouseOut="this.start()">
               
          <%  
           sql = "select  * from Eas_News_List where ns_ntid = 119 and ns_check = 1 order by ns_time desc"
           set rs = ado_query(sql,conn)
            while not rs.eof
          %>
                
                  <td width="34%" height="130" valign="top">
                  
                  <table border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td width="10" height="86"><img src="Images/菱克特尔_r5_c4.png" width="10" height="81" /></td>
                <td width="113" valign="middle"><table width="113" height="81" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td width="113" height="10" valign="top" background="Images/菱克特尔_r5_c6.png"></td>
                  </tr>
                  <tr>
                    <td height="62"><%
                              if file_exists("EasCMS/$EasDB/UpFiles/News/"&rs("ns_image"),1) then
                                 echo "<a href=""productshow.asp?ns_id="&rs("ns_id")&"&ns_ntid="&rs("ns_ntid")&""" title=""点" &_
                                  "击查看详细信息"" target=""_blank"" onFocus=""this.blur()""><img src=""EasCMS/$EasDB/UpFiles/News/"&rs("ns_image")&""" width=""150"" height=""62"" border=""0""/></a>"
                                else
                                   echo "<a href=""productshow.asp?ns_id="&rs("ns_id")&"&ns_ntid="&rs("ns_ntid")&""" title=""点" &_
                                      "击查看详细信息"" onFocus=""this.blur()""><img src='Images/pic_2.jpg'  border=""0"" width=""150"" height=""62""></a>"
                              end if
                          %></td>
                  </tr>
                  <tr>
                    <td height="9" background="Images/菱克特尔_r5_c6.png"></td>
                  </tr>
                </table></td>
                <td width="10"><div align="left"><img src="Images/菱克特尔_r5_c8.png" width="8" height="81" /></div></td>
              </tr>
              <tr>
                <td colspan="3"><div align="center"><span style="font-size: 12px; color: #999999"><%=rs("ns_skim")%></span></div></td>
              </tr>
              <tr>
                <td colspan="3">&nbsp;</td>
              </tr>
            </table>
        
            </td>
               
                 <%   rs.movenext
                         wend
                         if rs.recordcount = 0 then echo "暂无信息"
                    %>
                    </marquee>

我用marquee后 为什么不滚动 而且定义的宽度被撑开了
应该用什么方法好
1 回复
#2
nicechlk2008-10-06 14:10
你应该仔细检查代码,这个你参考一下吧:
<tabel width="600" border="0" .....>
<tr><td height="30" width="160" class=....>
<marquee height="120" direction="up" onMouseOver="this.stop()" onMouseOut="this.start()" scrollamount="2">
<%循环语句,从数据库读取%>
</marquee>
</td></tr>
</table>
总之,marquee要在外围。
1