1.asp.net 分页代码 首页 上一页 1 2 3 4 5 >> …… 30 下一页 尾页
asp.net 分页代码 首页 上一页 1 2 3 4 5 >> …… 30 下一页 尾页
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org//xhtml" xml:lang="gb" >
<head>
<meta http-equiv="content-type" content="text/html; charset=gb" />
<meta name="author" content="Smiling Dolphin" />
<meta name="keywords" content="design,码笔情书源码 css, cascading, style, sheets, xhtml, graphic design, w3c, web standards, visual, display, java, javascript, c++, php, jsp, asp, py, pl" />
<meta name="description" content="my favorites language." />
<meta name="robots" content="all" />
<title>仿豆瓣分页原型(Javascript版)</title>
<style type="text/css" title="currentStyle" media="screen">
/* Paginator */
.paginator {
font: .8px normal Arial, Helvetica, sans-serif;
color: #;
margin-top: px;
margin-bottom: 5px;
line-height: %;
background-color: #EEFFEE;
text-align: center;
}
.paginator a, .thispage, .break {
padding: 2px 4px;
}
.paginator .prev {
margin-right: px;
}
.paginator .next {
margin-left: px;
}
.paginator .count {
margin-left: px;
font-size: px;
}
</style>
</head>
<body>
<div id="pagebar" class="paginator"></div>
<script language="javascript" type="text/javascript">
function QueryString(item){
var sValue=location.search.match(new RegExp("[\?\&]"+item+"=([^\&]*)(\&?)","i"))
return sValue?sValue[1]:sValue
}
var count = ;
var perpage = ;
var currentpage = QueryString("page");
if (currentpage==null){
currentpage = 1;
}else{
currentpage = parseInt(currentpage);
}
var pagecount = Math.floor(count/perpage);
if(perpage*pagecount!=count)pagecount++;
var pagestr = "";
var breakpage = 9;
var currentposition = 4;
var breakspace = 2;
var maxspace = 4;
var prevnum = currentpage-currentposition;
var nextnum = currentpage+currentposition;
if(prevnum<1) prevnum = 1;
if(nextnum>pagecount) nextnum = pagecount;
pagestr += (currentpage==1)?'<span class="prev">< 前页</span>':'<span class="prev">< <a href="?page='+(currentpage-1)+'">前页</a></span>';
if(prevnum-breakspace>maxspace){
for(i=1;i<=breakspace;i++)
pagestr += '<a href="?page='+i+'">'+i+'</a>';
pagestr += '<span class="break">...</span>';
for(i=pagecount-breakpage+1;i<prevnum;i++)
pagestr += '<a href="?page='+i+'">'+i+'</a>';
}else{
for(i=1;i<prevnum;i++)
pagestr += '<a href="?page='+i+'">'+i+'</a>';
}
for(i=prevnum;i<=nextnum;i++){
pagestr += (currentpage==i)?'<span class="thispage">'+i+'</span>':'<a href="?page='+i+'">'+i+'</a>';
}
if(pagecount-breakspace-nextnum+1>maxspace){
for(i=nextnum+1;i<=breakpage;i++)
pagestr += '<a href="?page='+i+'">'+i+'</a>';
pagestr += '<span class="break">...</span>';
for(i=pagecount-breakspace+1;i<=pagecount;i++)
pagestr += '<a href="?page='+i+'">'+i+'</a>';
}else{
for(i=nextnum+1;i<=pagecount;i++)
pagestr += '<a href="?page='+i+'">'+i+'</a>';
}
pagestr += (currentpage==pagecount)?'<span class="next">后页 ></span>':'<span class="next"><a href="?page='+(currentpage+1)+'">后页</a> ></span>';
document.getElementById("pagebar").innerHTML = pagestr;
</script>
</body>
</html>
2024-11-29 02:132848人浏览
2024-11-29 01:54982人浏览
2024-11-29 01:501498人浏览
2024-11-29 01:37351人浏览
2024-11-29 01:241197人浏览
2024-11-29 01:042526人浏览
1.php?߲?Դ??2.关于蔬菜的英语单词php?߲?Դ?? 现在食品安全问题备受关注,许多人更愿意选择自己种植的蔬菜以确保食用安全。阳台菜园成为了一种流行的居家生活方式,它不仅能够提供新鲜的绿
1.dts透传是什么意思2.杜比/dts透传输出是什么意思吗3.求教,电信送的机顶盒里的声音配置!HDMI透传和非透传还有 SPIDF DTS是什么意思?选那个最4.DTS源码透传是什么意思5.什么是
1.java��ԴϵͳԴ��2.秒建一个后台管理系统?用这5个开源免费的Java项目就够了3.源码是什么?4.基于Java商城 免费 开源 SpringBoot 新零售网店商城系统java��ԴϵͳԴ