A cópia do código é a seguinte:
(função ($) {
$ .fn.tablepage = function (oobj, dcountofpage, fresh_id) {
var dpageIndex = 1;
var dnowIndex = 1;
var spaGest = "";
var dCount = 0;
var osource = $ (this);
var snoselcolor = "#cccccc";
var sselcolor = "preto";
var sfontcolor = "branco";
var nowIndex = 1;
change_page_content ();
função alteração_page_content () {
// Obtenha material
dCount = Osource.Children (). Children (). Comprimento;
// Mostrar
spaGest = "<div class = 'ref'> <a href = 'javascript: void (0)' id = 'fresh_"
+ fresh_id
+ "'OnClick =' Fresh (this.id);
Spagest += "<div class = 'msdn'> <a href = 'javascript: void (0)'> home </a> <a href = 'javascript: void (0)'> página anterior </a> < a href = 'javascript: void (0)'> próxima página </a> <a href = 'javascript: void (0)'> última página </a> </div> ";
SpageSt+= "<div class = 'txt'>"+"total"+math.ceil (dcount / dcountOfpage)+"página, atualmente o"+"<strong>"+dnowIndex+"</strong>"+" "+" </div> ";
OOBJ.HTML (SPAGEST);
dpageIndex = 1;
// Conteúdo da tabela
var rr = Osource.Children (). crianças ("tr");
Osource.Children (). Crianças ("Tr"). Cada (function () {
// == 2
if (dpageIndex> = (((dnowIndex - 1) * dCountOfpage) + 1)
&& dpageIndex <= ((dnowIndex * dCountOfPage)) {
$ (this) .show ();
} outro {
$ (this) .hide ();
}
dpageIndex ++;
});
//osource.Children (). Crianças ("tr"). Primeiro (). Mostrar ();
if (dcount <= dCountOfpage) {
var tt = $ ("#tabela_page _"+fresh_id) .children ('. msdn'). crianças (). cada (função (i) {
if (i == 2 || i == 3 || i == 0 || i == 1) {
$ (this) .addclass ("desativado");
}
});
}
caso contrário, if (dnowIndex == Math.ceil (DCount / DCountOfPage)) {
var tt = $ ("#tabela_page _"+fresh_id) .children ('. msdn'). crianças (). cada (função (i) {
if (i == 2 || i == 3) {
$ (this) .addclass ("desativado");
}
});
} else if (dnowIndex == 1) {
var tt = $ ("#tabela_page _"+fresh_id) .children ('. msdn'). crianças (). cada (função (i) {
if (i == 0 || i == 1) {
$ (this) .addclass ("desativado");
}
});
}
// Participe do evento
oobj.children (). Children (). Cada (function () {
$ (this) .Click (function () {
dnowIndex = $ (this) [0] .innerhtml;
if (dnowIndex == 'home') {
dnowIndex = 1;
change_page_content ();
NowIndex = dnowIndex;
}
if (dnowIndex == 'última página') {
dnowIndex = math.ceil (DCount / DCountOfPage);
change_page_content ();
NowIndex = dnowIndex;
}
if (dnowIndex == 'Próxima página') {
if (NowIndex <Math.ceil (DCount / DCountOfpage)) {
dnowIndex = parseInt (NowIndex) + 1;
change_page_content ();
NowIndex = NowIndex + 1;
}
}
if (dnowIndex == 'Página anterior') {
if (nowIndex> 1) {
dnowIndex = parseint (agoraIndex) - 1;
change_page_content ();
NowIndex = NowIndex - 1;
}
}
});
});
}
};
}) (jQuery);
A cópia do código é a seguinte:
<script type = "text/javascript">
$ (document) .ready (function () {
var totalpage = $ ("ul li"). Comprimento;
var total = math.ceil ($ ("ul li"). comprimento / 5);
Var Current = 1;
// var index = 4;
if (totalpage> 5) {
$ ("ul li: gt (4)"). hide ();
$ ("#btnprev"). att ("classe", "tabs-scroller-left-Disabled"). att ("desativado", "desativado"). clique (function () {
depurador;
$ ("#BTNNEXT"). Att ("classe", "tabs-scroller-right");
$ ("#btnNext"). removeattr ("desativado");
atual -= 1;
var tt = atual;
$ ("ul li"). show ();
var indexstart = (atual - 1);
var indexEnd = indexstart + 4;
$ ("li: lt (" + indexstart + "), li: gt (" + indexend + ")", $ ("ul")). hide ();
if (atual == 1) {
$ (this) .attr ("classe", "tabs-scroller-left-disabled");
$ (this) .attr ("desativado", "desativado");
}
});
$ ("#btnnext"). Clique (function () {
depurador;
$ ("#BTNPrev"). Att ("classe", "tabs-scroller-left");
$ ("#btnprev"). removeattr ("desativado");
corrente += 1;
$ ("ul li"). show ();
var indexstart = (atual - 1);
var indexEnd = corrente + 4> $ ("ul li"). Comprimento - 1?
$ ("li: lt (" + indexstart + "), li: gt (" + indexend + ")", $ ("ul")). hide ();
if (atual+4> = totalpage) {
$ (this) .attr ("classe", "tabs-scroller-right-DisLesabled");
$ (this) .attr ("desativado", "desativado");
}
});
}outro{
alerta (1);
$ ("#btnprev"). att ("classe", "tabs-scroller-left-Disabled");
$ ("#btnnext"). att ("classe", "tabs-scroller-right-Disababled");
}
});
</script>