论坛里提问的代码、、图片滚动

<META http-equiv=Content-Type content="text/html; charset=gb2312">
<!--最新图文代码开始-->
<script language="JavaScript">
<!--
var flag=false;
function DrawImage(ImgD){
 var image=new Image();
 image.src=ImgD.src;
 if(image.width>0 && image.height>0){
  flag=true;
  if(image.width/image.height>= 105/80){
   if(image.width>105){
    ImgD.width=105;
    ImgD.height=(image.height*105)/image.width;
   }else{
    ImgD.width=image.width;
    ImgD.height=image.height;
   }
   ImgD.alt="点击查看详细信息...";
  }
  else{
   if(image.height>80){
    ImgD.height=80;
    ImgD.width=(image.width*80)/image.height;
   }else{
    ImgD.width=image.width;
    ImgD.height=image.height;
   }
   ImgD.alt="点击查看详细信息...";
  }
 }
}
//-->
</script>
<%
Const New_img=10     
set rs_Product=server.createobject("adodb.recordset")
sqltext="select* from Product where Passed=True and Newproduct=true order by UpdateTime desc"
rs_Product.open sqltext,conn,1,1
if not rs_Product.EOF then%>
<div id=demo style=overflow:hidden;height:150;width:438;color:#ffffff>
<div id=demo1>
<!--滚动区的高度和宽度-->
    <table width='100%' cellpadding='0' cellspacing='0' border='0' align='center'>
      <tr valign='top'>
        <%
 while not rs_Product.EOF
 fileExt=lcase(getFileExtName(rs_Product("DefaultPicUrl")))  
 %>
        <td align='center'>
          <TABLE width=100% border=0 align=center cellPadding=0 cellSpacing=0>
            <TR>
              <TD width=8 rowspan=3 >&nbsp;</TD>
       <TD vAlign=top width=8><img src='Images/bg_0ltop.gif' width=10 height=10></TD>
       <TD background=images/bg_01.gif></TD>
       <TD vAlign=top width=7><img src='Images/bg_0rtop.gif' width=10 height=10></TD>
       <TD width=7 rowspan=3 vAlign=top><div align="center"></div></TD>
      </TR>
            <TR>
              <TD background='Images/bg_03.gif'>&nbsp;</TD>
       <TD width="105" height="85" align="center" bgcolor="#E9E9E9">
         <div align="center"><a href='ProductShow.asp?ID=<%=rs_Product("ID")%>' target=_blank title='<%=rs_Product("title")%>'>
            <%if fileext="jpg" or fileext="bmp" or fileext="png" or fileext="gif" then%>
           <img src="<%if rs_Product("DefaultPicUrl")="" then%>Img/nopic.gif<%else%><%=rs_Product("DefaultPicUrl")%><%end if%>" alt="<%=rs_Product("title")%>" width="105" height="80" border="0" οnlοad="javascript:DrawImage(this);">
                        <%else
   if fileext="swf" then%>
            <object  classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'  codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0' width='105' height='84'>
              <param name=movie value='<%=rs_Product("DefaultPicUrl")%>'>
              <param name=quality value=high>
              <param name='Play' value='-1'>
              <param name='Loop' value='0'>
              <param name='Menu' value='-1'>
              <param name='wmode' value='transparent'>
              <embed src='<%=rs_Product("DefaultPicUrl")%>' width='105' height='84' pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash'></embed>
                </object>
          
                        <%end if
  end if%>
           </a> </div></TD>
        <TD background='Images/bg_04.gif'>&nbsp;</TD>
      </TR>
            <TR>
              <TD><img src='Images/bg_0lbottom.gif' width=10 height=10></TD>
       <TD><img src='Images/bg_02.gif'></TD>     
       <TD><img src='Images/bg_0rbottom.gif' width=10 height=10></TD>
       </TR>
            <TR>
              <TD>&nbsp;</TD>
       <TD colspan=3 align=center height=20 valign='top' background='Images/bg_05.gif'>
          <a href='ProductShow.asp?ID=<%=rs_Product("ID")%>' target=_blank title='<%=rs_Product("title")%>'><%=cutstr(rs_Product("title"),8)%></a>      </TD>
        <TD>&nbsp;</TD>
      </TR>
            </TABLE>     </td>
     <%
   rs_Product.MoveNext
 wend
 %>
         </tr>
       </table>
      </div>
<div id=demo2></div>
</div>
   <%if New_img >5 then%>
<script>
var speed=30
demo2.innerHTML=demo1.innerHTML
function Marquee(){
if(demo2.offsetTop-demo.scrollTop<=0)
demo.scrollTop-=demo1.offsetHeight
else{
demo.scrollTop++
}
}
var MyMar=setInterval(Marquee,speed)
demo.οnmοuseοver=function() {clearInterval(MyMar)}
demo.οnmοuseοut=function() {MyMar=setInterval(Marquee,speed)}
</script>
 <%end if
else
 Response.Write "暂 无 最 新 图 文"
end if
rs_Product.close
set rs_Product=nothing
%>
<!--最新图文代码结束-->

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值