layui的js代码
/*! layPage-v1.3.0 分页组件 License MIT http://laypage.layui.com/ By 贤心 */
; !
function() {
"use strict";
function a(d) {
var e = "laypagecss";
a.dir = "dir" in a ? a.dir: f.getpath + "/skin/laypage.css",
new f(d),
a.dir && !b[c](e) && f.use(a.dir, e)
}
a.v = "1.3";
var b = document,
c = "getElementById",
d = "getElementsByTagName",
e = 0,
f = function(a) {
var b = this,
c = b.config = a || {};
c.item = e++,
b.render(!0)
};
f.on = function(a, b, c) {
return a.attachEvent ? a.attachEvent("on" + b,
function() {
c.call(a, window.even)
}) : a.addEventListener(b, c, !1),
f
},
f.getpath = function() {
var a = document.scripts,
b = a[a.length - 1].src;
return b.substring(0, b.lastIndexOf("/") + 1)
} (),
f.use = function(c, e) {
var f = b.createElement("link");
f.type = "text/css",
f.rel = "stylesheet",
f.href = a.dir,
e && (f.id = e),
b[d]("head")[0].appendChild(f),
f = null
},
f.prototype.type = function() {
var a = this.config;
return "object" == typeof a.cont ? void 0 === a.cont.length ? 2 : 3 : void 0
},
f.prototype.view = function() {
var b = this,
c = b.config,
d = [],
e = {};
if (c.pages = 0 | c.pages, c.curr = 0 | c.curr || 1, c.groups = "groups" in c ? 0 | c.groups: 5, c.first = "first" in