测试地址:www.100wan.com.cn/shop/index.asp
[开发原因]:
不小心给客户用了这套系统,收了人家的钱财要为人消灾,入得贼船,没有办法..客户需要点击小图片探出大图片.
[开发思路]
利用动易自定义字段功能增加字段, 在新制作页面进行展示
[使用说明]:
1. 利用动易自定义字段功能,打开商城管理自定义字段管理开始 制作标签,按顺序添加新字段MY_Bigpic1\MY_Bigpic2\MY_Bigpic3\MY_Bigpic4 想要多少就填多少,不要客气
2. 打开内容摸版找到{$ProductThumb},增加链接,
并加入script代码,
<script language="javascript">
<!--
function openit2(sURL){
newwindow=open(sURL,"popupnav","scrollbars=no,toolbar=no,directories=no,menubar=no,resizable=no,status=no,width=640,height=493");
}
//-->
</script>
3.开始做作页面
**************************************
* 开发者:[百万宝贝]石头 *
* 演示网站:www.100wan.com.cn *
* 程序:动易2005sp1 *
**************************************
<!--#include file="../conn.asp"-->
<html>
<head>
<title>百万商城-大图展示</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body leftmargin=0 topmargin=0 >
<!-- 小图片鼠标经过控制,展示大图片的js -->
<script language="javascript">
<!--
function ChangeImage(imageUrl)
{
if (imageUrl.length == 0){return;}
if (document.getElementById("bigPicture"))
{
var showObj = document.getElementById("bigPicture");
showObj.src = imageUrl;
}
}
-->
</script>
<!-- 判断错误 -->
<%
sub mb(byval txt,byval url,byval go)
response.write "<script language=javascript>alert('"&txt&"');"
if go<>1 then
response.write "history.go(-1);"
else
response.write "document.location.href='"&url&"';"
end if
response.write "</script>"
response.end
end sub
Dim strProductID
Dim rs
Dim IsNoPic
IsNoPic = true
strProductID = trim(request("ProductID"))
if strProductID = "" or not IsNumeric(strProductID) then
call mb("对不起,请制定正确的ProductID!","/shop/index.asp",1)
Response.End
end if
sql="select * from PE_Product where ProductID= " & strProductID
'rs.open sql,conn,3,2
Set rs = Conn.Execute(sql)
if rs.bof and rs.eof then
call mb("对不起,请制定正确的ProductID!","/shop/index.asp",1)
end if
%>
<table width="100%" border="0" cellpadding="4" cellspacing="0" bordercolor="#333333">
<tr>
<!-- 图片缩小展示 -->
<%
Dim i
Dim strFieldName
for i = 1 to 4 '你定义的大图片名称后的编号,这里表示4个
strFieldName = "MY_Bigpic" '你定义的大图片名称
strFieldName = strFieldName & i
'Response.Write strFieldName & "<br>"
if rs(strFieldName) <> "" then
response.write " <td width='90'><A href='#'><img src='" & rs(strFieldName) & "'width='90' height='60' class='pic_show' id='smallPicture' border='0' onmouseover='ChangeImage(this.src)' ></a> </td>" '控制鼠标经过小图片,在下面展示大图片
IsNoPic = false
end if
next
if IsNoPic then
response.write " <td><IMG src='/images/nopic.gif' ></td>" '没有大图显示nopic
end if
%>
<td></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="1" bgcolor="#CC0066" ></td>
</tr>
</table>
<br><!-- '打开页面展示第一个大图 -->
<IMG id="bigPicture" alt="点击查看更多图片" src="<%=rs("MY_Bigpic1")%>" width="640" border="0">
<%rs.close
set rs=nothing
%>
http://www.q127.com/rjxz/cj/2005/0307/2005111713524212029.zip