| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 421 人关注过本帖
标题:连接对象改为图像连接?
只看楼主 加入收藏
yangzhiyon
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2006-1-18
收藏
 问题点数:0 回复次数:1 
连接对象改为图像连接?
这是一段产品展示的代码,在该代码中应用了document。write等,并且当一行不满时,自动在后面加上:“暂无内容”等信息,产品连接是用文字进行的。请问如何更改连接到图像。


<%
SQL="Select * from product where (pro_name='product' and fenlei='6')"
Set rs=Server.CreateObject("ADODB.RecordSet")
rs.Open SQL,con,1,1
rs.PageSize=12
count=1
if Request("count")<>"" then
count=Cint(Request("count"))
if count<1 then
count=1
end if
if count>rs.PageCount then
count=rs.PageCount
end if
end if
if not rs.Bof and not rs.Eof then
rs.ABSolutePage=count
end if
pagecountx=rs.pagecount
for i=0 to 2
if i*4>=rs.RecordCount-((count-1)*rs.PageSize) then
exit for
end if
%>

<table width="595" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="19">&nbsp;</td>
<td width="124">

<table width="124" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td colspan="3"><img src="image/mm_r1_c1.jpg" width="124" height="4"></td>
</tr>
<tr>
<td width="5" background="image/mm_r2_c1.jpg"><img src="image/mm_r2_c1.jpg" width="5" height="150"></td>
<td width="108" valign="top"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="image/mm_r2_c2.jpg" width="108" height="100" name="img<%=i%>1"></td>
</tr>
<tr>
<td height="50" valign="top"> <table width="100%" border="0" cellspacing="2" cellpadding="0">
<tr>
<td valign="middle" class="text03"> <p><a href="#" id="a<%=i%>1"><font id=f<%=i%>1>暂无内容</font></a></p></td>
</tr>
</table></td>
</tr>
</table></td>
<td width="11" background="image/mm_r2_c3.jpg"><img src="image/mm_r2_c3.jpg" width="11" height="150"></td>
</tr>
<tr>
<td colspan="3"><img src="image/mm_r4_c1.jpg" width="124" height="6"></td>
</tr>
</table></td>
<td width="19">&nbsp;</td>
<td width="124"> <table width="124" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td colspan="3"><img src="image/mm_r1_c1.jpg" width="124" height="4"></td>
</tr>
<tr>
<td width="5" background="image/mm_r2_c1.jpg"><img src="image/mm_r2_c1.jpg" width="5" height="150"></td>
<td width="108" valign="top"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="image/27.jpg" width="108" height="100" name="img<%=i%>2"></td>
</tr>
<tr>
<td height="50" valign="top"> <table width="100%" border="0" cellspacing="2" cellpadding="0">
<tr>
<td valign="middle"><p class="text03"><a href="#" id="a<%=i%>2"><font id=f<%=i%>2>暂无内容</font></a></p></td>
</tr>
</table></td>
</tr>
</table></td>
<td width="11" background="image/mm_r2_c3.jpg"><img src="image/mm_r2_c3.jpg" width="11" height="150"></td>
</tr>
<tr>
<td height="6" colspan="3"><img src="image/mm_r4_c1.jpg" width="124" height="6"></td>
</tr>
</table></td>
<td width="19">&nbsp;</td>
<td width="124"> <table width="124" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td colspan="3"><img src="image/mm_r1_c1.jpg" width="124" height="4"></td>
</tr>
<tr>
<td width="5" background="image/mm_r2_c1.jpg"><img src="image/mm_r2_c1.jpg" width="5" height="150"></td>
<td width="108" valign="top"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>

<td><img src="image/28.jpg" name="img<%=i%>3" width="108" height="100" id="img<%=i%>3"></td>
</tr>
<tr>
<td height="50" valign="top"> <table width="100%" border="0" cellspacing="2" cellpadding="0">
<tr>
<td valign="middle"><p class="text03"><a href="#" id="a<%=i%>3"><font id=f<%=i%>3>暂无内容</font></a></p></td>
</tr>
</table></td>
</tr>
</table></td>
<td width="11" background="image/mm_r2_c3.jpg"><img src="image/mm_r2_c3.jpg" width="11" height="150"></td>
</tr>
<tr>
<td height="6" colspan="3"><img src="image/mm_r4_c1.jpg" width="124" height="6"></td>
</tr>
</table></td>
<td width="19">&nbsp;</td>
<td width="124"> <table width="124" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td colspan="3"><img src="image/mm_r1_c1.jpg" width="124" height="4"></td>
</tr>
<tr>
<td width="5" background="image/mm_r2_c1.jpg"><img src="image/mm_r2_c1.jpg" width="5" height="150"></td>
<td width="108" valign="top"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>

<td><img src="image/29.jpg" name="img<%=i%>4" width="108" height="100" id="img<%=i%>4"></td>
</tr>
<tr>
<td height="50" valign="top"> <table width="100%" border="0" cellspacing="2" cellpadding="0">
<tr>
<td valign="middle"><p class="text03"><a href="#" id="a<%=i%>4"><font id="f<%=i%>4">暂无内容</font></a></p></td>
</tr>
</table></td>
</tr>
</table></td>
<td width="11" background="image/mm_r2_c3.jpg"><img src="image/mm_r2_c3.jpg" width="11" height="150"></td>
</tr>
<tr>
<td height="6" colspan="3"><img src="image/mm_r4_c1.jpg" width="124" height="6"></td>
</tr>
</table></td>
<td width="23">&nbsp;</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>&nbsp;</td>
</tr>
</table>
<%

next

%>

<table width="562" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="image/36.jpg" width="562" height="1"></td>
</tr>
<tr class="text03">
<td><div align="right"><!--#include file="fy.asp" -->
</div></td>
</tr>
</table>
<%
rs.Close
Set rs=nothing
SQL="Select * from product where (pro_name='product' and fenlei='6') order by id desc"
Set rs=Server.CreateObject("ADODB.RecordSet")
rs.Open SQL,con,1,1
rs.PageSize=12
if not rs.Bof and not rs.Eof then
rs.ABSolutePage=count
end if
k=0
t=1
Response.write("<script>"&chr(13))
for i=1 to rs.PageSize
if ((count-1)*rs.PageSize)+i>rs.RecordCount then
exit for
end if
if rs("img")<>"" and vartype(rs("img"))<>1 then

Response.write("document.img"&k&t&".src='admin/img/"&rs("img")&"'"&chr(13))
end if


Response.write("document.all.a"&k&t&".href='product_more.asp?id="&rs("id")&"'"&chr(13))

Response.write("document.all.f"&k&t&".innerHTML='"&rs("title")&"'"&chr(13))
t=t+1
if i mod 4 =0 then
k=k+1
t=1
end if
rs.movenext
next
rs.Close
Set rs=nothing
Response.write("</script>")
%>
</div></td>
</tr>
</table>
搜索更多相关主题的帖子: 图像 对象 
2006-01-18 09:12
syh878
Rank: 1
等 级:新手上路
威 望:2
帖 子:461
专家分:0
注 册:2005-9-2
收藏
得分:0 
rs("img")是不是图片的地址啊?

2006-01-18 09:59
快速回复:连接对象改为图像连接?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.018112 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved