1个回答
展开全部
具体的链握弯接?
答案
将以下代码另存为default.asp再在本地运行可得到效果
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<style>
a{display:block; float:left; width:25px; height:25px; line-height:25px; text-align:center;border:1px solid #CCC;margin-right:3px; text-decoration:none; color:#000}
a:hover{color:#F90}
a.current{display:block; float:left; width:25px; height:25px; line-height:25px; text-align:center;border:1px solid #CCC;margin-right:3px; color:#F00}
a.current:hover{color:#F90}
a.link1{display:block; float:left; width:100px}
</盯陪style>
</head>
<body>
<%
page=request("page")
if page="" then page=1
%>
<a class="link1" href="default.asp?page=<%=page-1%>">上一页</a> <%pageset page,20,"http://localhost/default.asp"%> <a class="link1" href="default.asp?page=<%=page+1%>">下一页</a>
<%
function pageset(cpage,tpage,link)
if cpage<10 then
startpage=1
if tpage<10 then
tpage=tpage
else
endpage=10
end if
else
startpage=cpage-4
endpage=cpage+5
if endpage>tpage then
endpage=tpage
startpage=endpage-10
end if
end if
for i=startpage to endpage
if i=clng(cpage) then
response.write "<a class='current' href='javascript:void(0)'>"&i&"</a>"
else
response.write "<a href='"&link&凯皮蠢"?page="&i&"'>"&i&"</a> "
end if
next
end function
%>
</body>
</html>
答案
将以下代码另存为default.asp再在本地运行可得到效果
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<style>
a{display:block; float:left; width:25px; height:25px; line-height:25px; text-align:center;border:1px solid #CCC;margin-right:3px; text-decoration:none; color:#000}
a:hover{color:#F90}
a.current{display:block; float:left; width:25px; height:25px; line-height:25px; text-align:center;border:1px solid #CCC;margin-right:3px; color:#F00}
a.current:hover{color:#F90}
a.link1{display:block; float:left; width:100px}
</盯陪style>
</head>
<body>
<%
page=request("page")
if page="" then page=1
%>
<a class="link1" href="default.asp?page=<%=page-1%>">上一页</a> <%pageset page,20,"http://localhost/default.asp"%> <a class="link1" href="default.asp?page=<%=page+1%>">下一页</a>
<%
function pageset(cpage,tpage,link)
if cpage<10 then
startpage=1
if tpage<10 then
tpage=tpage
else
endpage=10
end if
else
startpage=cpage-4
endpage=cpage+5
if endpage>tpage then
endpage=tpage
startpage=endpage-10
end if
end if
for i=startpage to endpage
if i=clng(cpage) then
response.write "<a class='current' href='javascript:void(0)'>"&i&"</a>"
else
response.write "<a href='"&link&凯皮蠢"?page="&i&"'>"&i&"</a> "
end if
next
end function
%>
</body>
</html>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询