posts - 23, comments - 6, trackbacks - 0, articles - 0
  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

滚动代码加入数据库调用

Posted on 2006-09-20 07:39 小傻 阅读(266) 评论(0)  编辑  收藏 所属分类: asp
纵向:  
  <%  
  sql="select   top   5   *   from   release   where   pid="&shengid&"   and   showflag=1   order   by   id   desc   "  
  set   getnews=server.createobject("adodb.recordset")  
  getnews.open   sql,strconn,3  
  %>  
  <table   width=98%   cellspacing=0     cellpadding=4   height=160     class=<%=getcss("p1c3table")%>1     bordercolor=<%=getcss("p1c3tablecolor")%>>  
  <tr>  
  <td>  
  <marquee   name='mymarquee'     height=160   behavior=scroll   direction=up       scrollamount=2   scrolldelay=120   onmouseover='this.stop()'   onmouseout='this.start()'>  
  <%  
  do   while   not   getnews.eof   %>  
  <p>  
  <img   src=images/1.gif>  
  <a   href=page3.asp?id=<%=getnews("id")%>&menustyle=release&ctype=1&sname=<%=request("sname")%>     target=_blank   >  
  <font   color=black><%=getnews("title")%></font><font   color=gray>(<%=ymd(getnews("pubtime"))%>)</font>  
  </a>  
  </p>  
  <%getnews.movenext    
      loop  
      set   getnews=nothing  
  %>  
  </marquee>  
  </td>  
  </tr>  
  </table>    
   
  横向(如新浪的新闻,动态的。):  
  <table>  
  <tr   ><td>  
  <marquee   name='mymarquee'   behavior=scroll   direction=left   height=10     scrollamount=2     scrolldelay=120   onmouseover='this.stop()'   onmouseout='this.start()'>  
  <font   color=<%=getcss("marqueeword")%>><%=date%>&nbsp;&nbsp;<%   =   Session("UserName")   %>&nbsp;&nbsp;您好!</font>  
  <%   do   while   not   getm.eof   %>  
   
  <a   href=page3.asp?menustyle=release&id=<%=getm("id")%>&sname=<%=request("sname")%>     target=_blank>  
  <font   color=<%=getcss("marqueeword")%>><%=getm("title")%></font>  
  </a>  
  &nbsp;&nbsp;&nbsp;&nbsp;  
  <%  
  getm.movenext  
  loop  
  set   getm=nothing  
  %>  
  </marquee>  
  </td>  
  </tr>  
  </table>

只有注册用户登录后才能发表评论。


网站导航: