www.gusucode.com > 木犁IT产品管理系统 1.0 beta1码程序 > NewsProduct.asp

    <!--最新图文代码开始-->
<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=6   
set rs_Product=server.createobject("adodb.recordset")
sqltext="select top 6 title,pic1,id from news order by id desc"
rs_Product.open sqltext,conn,1,1
if not rs_Product.EOF then%>
<div align="center">
<div align='center' id='demo' style='overflow:hidden;height:125px;width:570;'><!--滚动区的高度和宽度-->
<table align='center' cellpadding='0' cellspace='0' border='0' id="table2">
<tr>
	<td id='demo1' valign='top'>
		<table width='100%' cellpadding='0' cellspacing='0' border='0' align='center' id="table3">
		<tr valign='top'>
	<%
	while not rs_Product.EOF
	'fileExt=lcase(getFileExtName(rs_Product("pic1")))		
	%>
			<td align='center'>
				<TABLE width=100% border=0 align=center cellPadding=0 cellSpacing=0 id="table4">
				<TR>
					<TD width=8 rowspan=3 > </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> </TD>
				</TR>
				<TR>
					<TD background='Images/bg_03.gif'> </TD>
					<TD width="105" height="85" align="center" bgcolor="#E9E9E9">
						<a href='ProductShow.asp?ID=<%=rs_Product("ID")%>' target=_blank title='<%=rs_Product("title")%>'>
							 <img src="<%if rs_Product("pic1")="" then%>nopic.gif<%else%><%=rs_Product("pic1")%><%end if%>" alt="<%=rs_Product("title")%>" width="105" height="80" border="0" onload="javascript:DrawImage(this);"></a>
						
	  			</TD>
	  			<TD background='Images/bg_04.gif'> </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> </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")%>'><%=left(rs_Product("title"),8)%></a>
	 				</TD>
	 				<TD> </TD>
				</TR>
	 			</TABLE>
			</td>
	  <%
	  rs_Product.MoveNext
	wend
	%>
		</tr>
		</table>
	</td>
	<td id=demo2></td>
</tr>
</table>
</div>
</div>
   <%if New_img >5 then%>
<script>
var Picspeed=30
demo2.innerHTML=demo1.innerHTML
function Marquee1(){
if(demo2.offsetWidth-demo.scrollLeft<=0)
demo.scrollLeft-=demo1.offsetWidth
else{
demo.scrollLeft++
}
}
var MyMar1=setInterval(Marquee1,Picspeed)
demo.onmouseover=function() {clearInterval(MyMar1)}
demo.onmouseout=function() {MyMar1=setInterval(Marquee1,Picspeed)}
</script>
	<%end if
else
	Response.Write "暂 无 最 新 图 文"
end if
rs_Product.close
set rs_Product=nothing
%>