If Not oRs.Eof Then
Do While Not oRs.Eof and i<maxperpage
nStr=nStr&"<div class=""item""><a href=""View.asp?PicID="&oRs("p_id")&""" title="""&oRs("P_PictureName")&"""><img src="""&oRs("P_PictureUrlS")&""" alt="""&oRs("P_PictureName")&""" /></a><p><a href=""View.asp?PicID="&oRs("p_id")&""" title="""&oRs("P_PictureName")&""">"&oRs("P_PictureName")&"</a></p></div>"&vbCrlf
if i mod 2=1 then nStr=nStr&"<div class=""blank5""></div>"
在<img src="""&oRs("P_PictureUrlS")&前面加一段代碼,可以讓后面顯示的圖片上面重疊一個小圖片,類似下面這種,這個網站是一個相冊網站。

下面送上完整的代碼
<!--#include file="head.asp"-->
<%
id=makeclng(Request("id"))
pLink="Product.asp?id="&id&""
If id<>0 Then
Set oRs=oConn.Execute("Select * From PictureClass Where ClassID="&id)
If oRs.Eof Then
id=0
WebTitle="商品串列"
else
ckey1=ors("ckey1")
ckey2=ors("ckey2")
ckey3=ors("ckey3")
WebTitle=ors("ClassName")
End If
oRs.Close
else
ckey1=""
ckey2=""
ckey3=""
WebTitle="最新圖片"
End If
%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Cache-control" content="max-age=1700">
<meta name="viewport" content="user-scalable=no, width=device-width">
<meta name="MobileOptimized" content="320">
<meta name="keywords" content="<%=ckey2%>,<%=W_WebSiteKeyword%>" />
<meta name="description" content="<%if ckey3<>"" then%><%=ckey3%><%else%><%=W_WebSiteIntr%><%end if%>"/>
<title><%=WebTitle%>-<%=siteName%></title>
<link href="https://bbs.csdn.net/topics/style/style.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="https://bbs.csdn.net/topics/js/jquery.min.js"></script>
<script type="text/javascript" src="https://bbs.csdn.net/topics/js/common.js"></script>
</head>
<body>
<!--#include file="top.asp"-->
<div class="blank"></div>
<div class="ur_here"><%=PicNavi(id)%></div>
<div class="blank"></div>
<div class="title"><h3><%=WebTitle%></h3>
<div class="type_more">
<div class="type_title">更多</div>
<div class="type_small">
<ul>
<%=initAllClass(getParent(id,3))%>
</ul>
</div>
</div>
</div>
<div class="blank5"></div>
<div class="goodslist">
<%
dim schsql
if id=0 then
else
schsql=schsql&" and P_PictureClassID in (select classid from pictureclass where classid="&id&" or parentid="&id&")"
'pLink=pLink&"&id="&id&""
end if
if keyword="" then
else
schsql=schsql&" and P_PictureName like '%"&keyword&"%'"
pLink=pLink&"&keyword="&keyword&""
end if
sSql="Select * From Picturedata Where P_Recycle=False "&schsql&" Order By P_order desc,P_ID Desc"
oRs.Open sSql,oConn,1,1
Dim PicNum
dim MaxPerPage
dim totalPut
dim CurrentPage
dim TotalPages
dim i
MaxPerPage=10
if not ors.eof then
ors.MoveFirst
end if
ors.pagesize=MaxPerPage
If trim(Request("Page"))<>"" then
If IsNumeric(trim(Request("Page"))) = False Then
GoError "分頁引數錯誤,請不要試圖破壞此系統。"
End If
CurrentPage= CLng(request("Page"))
If CurrentPage> ors.PageCount then
CurrentPage = ors.PageCount
End If
Else
CurrentPage= 1
End If
totalPut=ors.recordcount
if CurrentPage<>1 then
if (currentPage-1)*MaxPerPage<totalPut then
ors.move(currentPage-1)*MaxPerPage
dim bookmark
bookmark=ors.bookmark
end if
end if
dim n,k
if (totalPut mod MaxPerPage)=0 then
n= totalPut \ MaxPerPage
else
n= totalPut \ MaxPerPage + 1
end if
i=0
dim nStr
nStr=""
If Not oRs.Eof Then
Do While Not oRs.Eof and i<maxperpage
nStr=nStr&"<div class=""item""><a href=""View.asp?PicID="&oRs("p_id")&""" title="""&oRs("P_PictureName")&"""><img src="""&oRs("P_PictureUrlS")&""" alt="""&oRs("P_PictureName")&""" /></a><p><a href=""View.asp?PicID="&oRs("p_id")&""" title="""&oRs("P_PictureName")&""">"&oRs("P_PictureName")&"</a></p></div>"&vbCrlf
if i mod 2=1 then nStr=nStr&"<div class=""blank5""></div>"
i=i+1
oRs.MoveNext
Loop
nStr=nStr&initPage(pLink,totalPut,MaxPerPage,currentPage)
Else
nStr=nStr&"<div class=""page"">暫無資訊</div>"&vbCrlf
End If
oRs.Close
Response.Write nStr
%>
</div>
<!--#include file="bottom.asp"-->
</body>
</html>
uj5u.com熱心網友回復:
有沒有大神會啊,在顯示在圖片上面加一個小圖片遮擋就可以uj5u.com熱心網友回復:
自己用css position定位到底圖上面,如果是二維碼有一種是可以在中間插入一個小圖示的uj5u.com熱心網友回復:
給上面的那張圖設定浮動就完事uj5u.com熱心網友回復:
不會搞,有沒有幫忙寫一下uj5u.com熱心網友回復:
<div class="one">
<img src="https://img.uj5u.com/2020/09/26/137748260050252.jpg" alt="">
<div class="two">
<img src="https://img.uj5u.com/2020/09/26/137748260050252.jpg" alt="">
</div>
</div>
<style>
.one {
width: 200px;
}
.one img {
width: 100%;
}
.two {
border: 2px red solid;
width: 50px;
position: relative;
top: -85px; // 這里的上移需要自己根據圖片大小計算
left: 38%; // 這里的左移需要自己根據圖片大小計算
}
</style>
uj5u.com熱心網友回復:
你給我的這個我看的懂,但是我需要是在動態圖片的前面加,我不會怎么寫進去
uj5u.com熱心網友回復:
If Not oRs.Eof ThenDo While Not oRs.Eof and i<maxperpage
nStr=nStr&"<div class=""item""><a href=""View.asp?PicID="&oRs("p_id")&""" title="""&oRs("P_PictureName")&"""><img src="""&oRs("P_PictureUrlS")&""" alt="""&oRs("P_PictureName")&""" /></a><p><a href=""View.asp?PicID="&oRs("p_id")&""" title="""&oRs("P_PictureName")&""">"&oRs("P_PictureName")&"</a></p></div>"&vbCrlf
if i mod 2=1 then nStr=nStr&"<div class=""blank5""></div>"
i=i+1
oRs.MoveNext
Loop
nStr=nStr&initPage(pLink,totalPut,MaxPerPage,currentPage)
那個浮在上面的圖片加加到這段代碼里面去,<img src="""&oRs("P_PictureUrlS")&""" alt="""&oRs("P_PictureName")&""" />這句代碼的前面
uj5u.com熱心網友回復:
If Not oRs.Eof ThenDo While Not oRs.Eof and i<maxperpage
nStr=nStr&"<div class=""item""><a href=""View.asp?PicID="&oRs("p_id")&""" title="""&oRs("P_PictureName")&"""><div class="one"><img src="""&oRs("P_PictureUrlS")&""" alt="""&oRs("P_PictureName")&""" /><div class="two"><img src="""&oRs("P_PictureUrlS")&""" alt="""&oRs("P_PictureName")&""" /></div></a><p><a href=""View.asp?PicID="&oRs("p_id")&""" title="""&oRs("P_PictureName")&""">"&oRs("P_PictureName")&"</a></p></div>"&vbCrlf
if i mod 2=1 then nStr=nStr&"<div class=""blank5""></div>"
i=i+1
oRs.MoveNext
Loop
nStr=nStr&initPage(pLink,totalPut,MaxPerPage,currentPage)
樣式寫上去直接替換
uj5u.com熱心網友回復:
<!--#include file="head.asp"--><%
id=makeclng(Request("id"))
pLink="Product.asp?id="&id&""
If id<>0 Then
Set oRs=oConn.Execute("Select * From PictureClass Where ClassID="&id)
If oRs.Eof Then
id=0
WebTitle="商品串列"
else
ckey1=ors("ckey1")
ckey2=ors("ckey2")
ckey3=ors("ckey3")
WebTitle=ors("ClassName")
End If
oRs.Close
else
ckey1=""
ckey2=""
ckey3=""
WebTitle="最新微信群二維碼"
End If
%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Cache-control" content="max-age=1700">
<meta name="viewport" content="user-scalable=no, width=device-width">
<meta name="MobileOptimized" content="320">
<meta name="keywords" content="<%=ckey2%>,<%=W_WebSiteKeyword%>" />
<meta name="description" content="<%if ckey3<>"" then%><%=ckey3%><%else%><%=W_WebSiteIntr%><%end if%>"/>
<title><%=WebTitle%>-<%=siteName%></title>
<link href="https://bbs.csdn.net/topics/style/style.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="https://bbs.csdn.net/topics/js/jquery.min.js"></script>
<script type="text/javascript" src="https://bbs.csdn.net/topics/js/common.js"></script>
</head>
<body>
<!--#include file="top.asp"-->
<div class="blank"></div>
<div class="ur_here"><%=PicNavi(id)%></div>
<div class="blank"></div>
<div class="title"><h3><%=WebTitle%></h3>
<div class="type_more">
<div class="type_title">更多</div>
<div class="type_small">
<ul>
<%=initAllClass(getParent(id,3))%>
</ul>
</div>
</div>
</div>
<div class="blank5"></div>
<div class="goodslist">
<%
dim schsql
if id=0 then
else
schsql=schsql&" and P_PictureClassID in (select classid from pictureclass where classid="&id&" or parentid="&id&")"
'pLink=pLink&"&id="&id&""
end if
if keyword="" then
else
schsql=schsql&" and P_PictureName like '%"&keyword&"%'"
pLink=pLink&"&keyword="&keyword&""
end if
sSql="Select * From Picturedata Where P_Recycle=False "&schsql&" Order By P_order desc,P_ID Desc"
oRs.Open sSql,oConn,1,1
Dim PicNum
dim MaxPerPage
dim totalPut
dim CurrentPage
dim TotalPages
dim i
MaxPerPage=10
if not ors.eof then
ors.MoveFirst
end if
ors.pagesize=MaxPerPage
If trim(Request("Page"))<>"" then
If IsNumeric(trim(Request("Page"))) = False Then
GoError "分頁引數錯誤,請不要試圖破壞此系統。"
End If
CurrentPage= CLng(request("Page"))
If CurrentPage> ors.PageCount then
CurrentPage = ors.PageCount
End If
Else
CurrentPage= 1
End If
totalPut=ors.recordcount
if CurrentPage<>1 then
if (currentPage-1)*MaxPerPage<totalPut then
ors.move(currentPage-1)*MaxPerPage
dim bookmark
bookmark=ors.bookmark
end if
end if
dim n,k
if (totalPut mod MaxPerPage)=0 then
n= totalPut \ MaxPerPage
else
n= totalPut \ MaxPerPage + 1
end if
i=0
dim nStr
nStr=""
If Not oRs.Eof Then
Do While Not oRs.Eof and i<maxperpage
nStr=nStr&"<div class=""item""><a href=""View.asp?PicID="&oRs("p_id")&""" title="""&oRs("P_PictureName")&"""><div class="one"><img src="https://img.uj5u.com/2020/09/26/137748260050254.png" /><div class="two"><img src="""&oRs("P_PictureUrlS")&""" alt="""&oRs("P_PictureName")&""" /></div></a><p><a href=""View.asp?PicID="&oRs("p_id")&""" title="""&oRs("P_PictureName")&""">"&oRs("P_PictureName")&"</a></p></div>"&vbCrlf
if i mod 2=1 then nStr=nStr&"<div class=""blank5""></div>"
i=i+1
oRs.MoveNext
Loop
nStr=nStr&initPage(pLink,totalPut,MaxPerPage,currentPage)
Else
nStr=nStr&"<div class=""page"">暫無資訊</div>"&vbCrlf
End If
oRs.Close
Response.Write nStr
%>
</div>
<style>
.one {
width: 200px;
}
.one img {
width: 100%;
}
.two {
border: 2px red solid;
width: 50px;
position: relative;
top: -85px; // 這里的上移需要自己根據圖片大小計算
left: 38%; // 這里的左移需要自己根據圖片大小計算
}
</style>
<!--#include file="bottom.asp"-->
</body>
</html>
按照你寫得這個改了,提示原始碼錯誤。。。。

uj5u.com熱心網友回復:
樣式放錯位置了,放到樣式檔案里面去。后面的// 注釋文字去掉 現在肯定是報語法錯誤了轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/129030.html
標籤:HTML(CSS)
上一篇:css3火狐縮放
下一篇:跳轉不按順序,請大佬幫我看看
