123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151 |
- <!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></title>
- <!-- <script type="text/javascript"> document.domain = "1473.cn";</script>-->
- <script src="http://www.1473.cn/uform.js" type="text/javascript"></script>
- <style>
- body{margin:0px; padding:0px;}
- .U_P_Y_Box {width:900px; height:36px;}
- .U_P_T_left{ margin:14px auto; background-position:-5px -5px; width:6px; height:9px; background-image:url(photo/2.png); background-repeat:no-repeat; -webkit-transform:scaleX(-1);}
- .U_P_T_left2{ margin:14px auto; background-position:-5px -43px; width:6px; height:9px; background-image:url(photo/2.png); background-repeat:no-repeat; -webkit-transform:scaleX(-1);}
- .U_P_Y_pageitem{width:36px; height:36px; color:#666; border:1px solid #e8e8e8;}
- .U_P_Y_page{width:36px; height:36px; color:#666; border:1px solid #e8e8e8; text-align:center; float:left; line-height:36px;}
- .U_P_T_right{margin:14px auto; background-position:-5px -5px; width:6px; height:9px; background-image:url(photo/2.png); background-repeat:no-repeat; }
- .U_P_T_right2{margin:14px auto; background-position:-5px -43px; width:6px; height:9px; background-image:url(photo/2.png); background-repeat:no-repeat; }
- .U_P_Y_DUO {width:36px; height:36px; color:#666;float:left; line-height:36px; text-align:center;}
- .U_P_Y_page:hover{width:36px; height:36px; color:#666; border:1px solid #f40; color:#f40;}
- .U_P_Y_pageground {width:36px; height:36px; color:#fff; border:1px solid #f40; text-align:center; float:left; line-height:36px;background:#f40;}
- .U_P_Y_font {color:#666; font-size:14px; float:left; margin:10px 0px 0px 10px;}
- .U_P_Y_Text{vertical-align:middle; text-align:center; width:40px; height:15px; margin:8px 0px 0px 0px; float:left;}
- .U_P_Y_Ar {width:50px; height:19px; background:#f40; color:#fff; font-size:14px; float:left; margin:8px 0px 0px 0px; text-align:center; display:none;}
- </style>
- <script>
- U.PAG = function () { }
- U.PAG.prototype = {
- init: function (config) { //初始化数据
- this.U_P_C_Page = 1; // 当前页
- this.U_P_C_PageData = config.PageData; //当前页数据 默认10
- this.U_P_C_TotalData = config.Arr.Title.length; // 总数据
- this.U_P_C_TotalPage = Math.ceil(this.U_P_C_TotalData / this.U_P_C_PageData); //总页数
- this.Array = config.Arr; //数组里面的东西
- this.LV();
- },
- LV: function () {
- var U_P_D_Box = $$("div", { "className": "U_P_Y_Box" }, document.body);
- var asr = this.U_P_C_TotalData - this.U_P_C_PageData * (this.U_P_C_Page - 1);
- var qqq = this.U_P_C_Page == this.U_P_C_TotalPage ? asr : this.U_P_C_PageData;
- for (var i = 0; i < qqq; i++) {
- var as = this.U_P_C_PageData * (this.U_P_C_Page - 1);
- var a = $$("div", { "innerHTML": this.Array.Title[as + i] }, U_P_D_Box);
- }
- var U_P_D_Total = $$("div", { "className": "U_P_Y_page", "onclick": [[this.selectPage, ([this, 'left'])]] }, U_P_D_Box);
- var U_P_D_Bleft = $$("div", { "className": this.U_P_C_Page == 1 ? "U_P_T_left2" : "U_P_T_left" }, U_P_D_Total);
- if (this.U_P_C_TotalPage <= 6) {
- for (var i = 1; i <= this.U_P_C_TotalPage; i++) {
- var U_P_D_Total = $$("div", { "className": this.U_P_C_Page == i ? "U_P_Y_pageground" : "U_P_Y_page" }, U_P_D_Box);
- var U_P_D_Bleft = $$("div", { "innerHTML": i, "onclick": [[this.selectPage, ([this])]] }, U_P_D_Total);
- }
- } else {
- if (this.U_P_C_Page <= 3) {
- for (var i = 1; i < 7; i++) {
- var U_P_D_Total = $$("div", { "className": this.U_P_C_Page == i ? "U_P_Y_pageground" : "U_P_Y_page" }, U_P_D_Box);
- var U_P_D_Bleft = $$("div", { "innerHTML": i, "onclick": [[this.selectPage, ([this])]] }, U_P_D_Total);
- }
- }
- else {
- var start = parseInt(this.U_P_C_Page) - 3;
- var end = parseInt(this.U_P_C_Page) + 3;
- if (end > this.U_P_C_TotalPage) {
- end = this.U_P_C_TotalPage;
- start = end - 6;
- }
- for (var i = start; i <= end; i++) {
- var U_P_D_Total = $$("div", { "className": this.U_P_C_Page == i ? "U_P_Y_pageground" : "U_P_Y_page" }, U_P_D_Box);
- var U_P_D_Bleft = $$("div", { "innerHTML": i, "onclick": [[this.selectPage, ([this])]] }, U_P_D_Total);
- }
- }
- if (this.U_P_C_Page >= (this.U_P_C_TotalPage - 3)) { } else {
- var U_P_D_Total = $$("div", { "className": "U_P_Y_DUO" }, U_P_D_Box);
- var U_P_D_Bleft = $$("div", { "innerHTML": "..." }, U_P_D_Total);
- }
- }
- var U_P_D_Total = $$("div", { "className": "U_P_Y_page", "onclick": [[this.selectPage, ([this, 'right'])]] }, U_P_D_Box);
- var U_P_D_Bleft = $$("div", { "className": this.U_P_C_Page == this.U_P_C_TotalPage ? "U_P_T_right2" : "U_P_T_right" }, U_P_D_Total);
- var U_P_Y_ParaTotaly = $$("div", { "innerHTML": "共" + this.U_P_C_TotalPage + "页", "className": "U_P_Y_font" }, U_P_D_Box);
- var U_P_Y_Fly = $$("div", { "innerHTML": "去第", "className": "U_P_Y_font" }, U_P_D_Box);
- var U_P_Y_Text = $$("input", { "value": this.U_P_C_Page, "type": "text", "className": "U_P_Y_Text", "onclick": [[this.blo, ([this])]] }, U_P_D_Box);
- var U_P_Y_Ar = $$("div", { "innerHTML": "确定", "className": "U_P_Y_Ar", "onclick": [[this.Fly, ([this])]] }, U_P_D_Box);
- var U_P_Y_Fly = $$("div", { "innerHTML": "页", "className": "U_P_Y_font" }, U_P_D_Box);
- document.onclick = (function (that) {
- return function () {
- var e = event || window.event;
- var aim = e.srcElement || e.target;
- if (e.srcElement) {
- var aim = e.srcElement;
- if (aim != U_P_Y_Text) {
- that.U_P_Y_Ar.style.display = "none";
- } else {
- var aim = e.target;
- if (aim != U_P_Y_Text) {
- that.U_P_Y_Ar.style.display = "none";
- }
- }
- }
- }
- })(this);
- this.U_P_Y_Text = U_P_Y_Text;
- this.U_P_Y_Ar = U_P_Y_Ar;
- this.U_P_D_Box = U_P_D_Box;
- },
- selectPage: function (that, n) {
- if (n == 'left') {
- if (that.U_P_C_Page == 1) {
- return false;
- } else {
- that.U_P_C_Page--;
- }
- } else if (n == 'right') {
- if (that.U_P_C_Page == that.U_P_C_TotalPage) {
- return false;
- } else {
- that.U_P_C_Page++;
- }
- } else {
- if (n) { that.U_P_C_Page = n; }
- else { that.U_P_C_Page = this.innerHTML; }
- }
- document.body.removeChild(that.U_P_D_Box);
- that.LV();
- },
- blo: function (that) {
- that.U_P_Y_Ar.style.display = "block";
- },
- Fly: function (that) {
- if (that.U_P_Y_Text.value > that.U_P_C_TotalPage) {
- return false;
- }
- that.selectPage(that, that.U_P_Y_Text.value);
- }
- }
- </script>
- <script type="text/javascript">
- window.onload = function () {
- var Array = {
- "Title": ["电脑", "冰箱", "手机", "空调", "灯泡", "玩具", "黑板", "本子", "被子", "杯子", "我", "蛋蛋", "我是", "徐杰风", "踩踩踩", "二厅", "无人", "离开码头", "问题", "无人", "太卡", "刘恺威", "了", "无污染"],
- "Content": ["这是内容", "这是内容", "这是内容", "这是内容", "这是内容", "这是内容", "这是内容", "这是内容", "这是内容", "这是内容", "我最想", "中文"]
- };
- var _C = new U.PAG();
- _C.init({
- PageData: 10, // 每页数据
- Arr: Array//总数据
- });
- }
- </script>
- </head>
- <body>
- </body>
- </html>
|