$(function() { var f = $(".pages_info"), a = $(".pages_info option"), d = [], m = null; if (!$("div").hasClass("pages_info")) return !1; f.html("
" + f.html()); d = $(".pages_none"); var g = $(".pages_none select"); d.hide(); d = d.html().split(" "); $.each(d, function(b, c) { -1 != c.indexOf("总数") && (m = c) }); f.append('
'); var h = $(".pages_box"), n = null, e = 0, p = ""; a.each(function(b) { n = $(this).attr("value"); e = b + 1; 0 == e && (e = 1); p = $(this).is(":checked") ? "page_curr" : ""; h.append('' + e) }); var b = $(".pages_box a"), q = a.first().val(), r = a.last().val(), k = !1, l = !1; 0 == g.html().length && (k = !0); 0 == g.html().length && (l = !0); b.each(function() { var bLen1 = b.length-1; $(this).hide(); q = $(".page_curr").prev().attr("href"); r = $(".page_curr").next().attr("href"); var a = $(".page_curr").index() - 2, c = $(".page_curr").index() + 2; 0 <= a && c <= bLen1 ? $(this).index() >= a && $(this).index() <= c && $(this).show() : 0 > a ? 0 <= $(this).index() && 4 >= $(this).index() && $(this).show() : c > bLen1 && 0 <= $(this).index() && $(this).index() <= bLen1 && $(this).index() >= bLen1 - 4 && $(this).show(); 0 == $(".page_curr").index() && (k = !0); $(".page_curr").index() == bLen1 && (l = !0) }); h.prepend('' + m + '首页上一页'); h.append('下一页尾页转到 '); $(".page_jump").append(g); k && ($(".page_pre").removeAttr("href"), $(".page_first").removeAttr("href")); l && ($(".page_next").removeAttr("href"), $(".page_last").removeAttr("href")) });