jquery-pager的使用

访问https://github.com/jonpauldavies/jquery-pager-plugin下载ZIP

按下面提示使用

<!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>
<title>jQuery.pager.js Test</title>
<link href="Pager.css" rel="stylesheet" type="text/css" />
<script src="jquery-1.4.2.min.js" type="text/javascript"></script>
<script src="jquery.pager.js" type="text/javascript"></script>
<script type="text/javascript" language="javascript">
//pagenumber 为当前页码
//pagecount 为显示页数
//PageClick 为回调函数
//pageclickednumber 为点击页码
$(document).ready(function() {
$(
"#pager").pager({ pagenumber: 1, pagecount: 10, buttonClickCallback: PageClick });
});

PageClick
= function(pageclickednumber) {
$(
"#pager").pager({ pagenumber: pageclickednumber, pagecount: 10, buttonClickCallback: PageClick });
$(
"#result").html("Clicked Page " + pageclickednumber);
}

</script>
</head>
<body>
<h1 id="result">Click the pager below.</h1>
<div id="pager" ></div>
</body>
</html>



你可能感兴趣的:(jquery)