如何使用smartpaginator分页插件

最近有意研究了http://www.it28.cn使用了jquery的smartpaginator分页插件,

现在与大家分享一下

1、引入css和js包
<link rel="stylesheet" href="/css/smartpaginator.css" />
<script type="text/javascript" src="/Scripts/smartpaginator.js"></script>

 

最后配置分页参数
<script type="text/javascript">
$(document).ready(function () {
$('.pagination').smartpaginator({
totalrecords: 33641,
recordsperpage: 35,
length: 15,
next: '下一页',
prev: '上一页',
first: '首 页',
last: '尾 页',
go: 'go',
theme: 'red',
controlsalways: true,
onchange: function (pageIndex) {
alert("这一块,加载你的分页内容")
},
error: function () {

$("#loadTbl").empty().html("<tr><td colspan='3' class='loadtext'>加载超时,请刷新...</td></tr>");
return false;
}
});

}
});
});
</script>

 

这样很简单的使用ajax分页,加载内容

特别申明:以上代码采集于www.it28.cn,需要CSS和JS包的朋友 可以到这个网站去下载

posted @ 2013-01-18 10:20  tangself  阅读(507)  评论(0编辑  收藏  举报