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,爱家源码和08房产源码 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-12-26 13:531741人浏览
2024-12-26 13:15716人浏览
2024-12-26 12:361592人浏览
2024-12-26 12:091268人浏览
2024-12-26 11:502194人浏览
2024-12-26 11:42877人浏览
春季是流行性病的高发季,为切实保障人民群众用药安全,近期,北京市门头沟区市场监管局开展春季药品安全专项监督检查,护航春季流行病高发期间用药安全。执法人员深入各大药品零售企业和医疗器械经营企业开展检查,
1.大富豪3手游源码大富豪3手游源码 下载地址:// 类型:安卓游戏-益智休闲 版本:v1.3.0 大小:.M 语言:中文 平台:安卓APK 推荐星级评
1.���Ͷ��ϵͳ Դ�����Ͷ��ϵͳ Դ�� 学网站的吗?怎么自己连代码都不会写,那你做网站简直是没有意义,说不定哪天那个小黑客就把你网站黑了你还不知道怎么回事,要是真想搞去找个小型的网络