jquery+css3打造一款ajax分页插件(自写)

2020-05-22 21:56:15易采站长站整理

return { reload: gopageChange, pageCount: pageCount, recount: function (e) {
//重新计算页数
config.dataCount = e;
pageIndex = 1;
initcount();
initpage();
gopageChange();
}
};

//console.log(_min + "*" + _max + "*" + pageCount);
}

})(jQuery)

样式kun_page.css:


/*
kun_page.css
lxk 2014.06.16
www.cnblogs.com/wingkun
*/

.kun_page {font-size: 12px;line-height:23px;font-family:"Microsoft YaHei";}
.kun_page .k_p_page{position:relative;}
.kun_page div {float: left;margin: 3px;border: solid 1px #ccc;cursor: pointer;color: #333;min-width:12px;text-align:center;padding:0px 5px;}
.kun_page em {display: block;float: left;margin: 2px;}
.kun_page .k_p_current {background: #ccc;color: #fff;-webkit-animation:scroll_b 300ms;animation:scroll_b 300ms;}
.kun_page .k_cl {clear: both;float: none;border: none;margin: 0px;padding: 0px;width:0px;height:0px;}
.kun_page .k_custom {display: block;float: left;margin: 3px 3px 3px 20px;}
.kun_page .k_ipt {width: 30px;height: 21px;border: solid 1px #ccc;text-align: center;vertical-align:middle;}
.kun_page .k_m{ opacity: 0; width: 1%; height: 1%;top:0px;left:0px; display:block; position: absolute; }
.kun_page .sc_l{background: -webkit-gradient(linear, 0 100%, 100% 100%, from(#CCCCCC), to(#645F5F));
-webkit-transform:translate(-50px);-webkit-animation:scroll_k_l 300ms linear;
background: -moz-linear-gradient(left,#CCCCCC 0%, #645F5F 100%);
background: -ms-linear-gradient(left,#CCCCCC 0%, #645F5F 100%);
transform:translate(-50px);animation:scroll_k_l 300ms linear;

}
.kun_page .sc_r{background: -webkit-gradient(linear, 0 100%, 100% 100%, from(#645F5F), to(#CCCCCC));
-webkit-transform:translate(50px); -webkit-animation:scroll_k_r 300ms linear;
background: -moz-linear-gradient(left, #645F5F 0%, #CCCCCC 100%);
background: -ms-linear-gradient(left,#CCCCCC 0%, #645F5F 100%);
transform:translate(50px); animation:scroll_k_r 300ms linear;
}

/*
animation
*/

@-webkit-keyframes scroll_k_l{
0%{-webkit-transform:translate(-100px);opacity:0.2;width:200%;height:100%;}
99%{-webkit-transform:translate(-20px);opacity:0;width:200%;height:100%;}
100%{-webkit-transform:translate(-20px);opacity:0;width:1%;height:1%;}
}

@-webkit-keyframes scroll_k_r{
0%{-webkit-transform:translate(100px);opacity:0.2;width:200%;height:100%;}
99%{-webkit-transform:translate(20px);opacity:0;width:200%;height:100%;}
100%{-webkit-transform:translate(20px);opacity:0;width:1%;height:1%;}
}

@keyframes scroll_k_l{
0%{transform:translate(-100px);opacity:0.2;width:200%;height:100%;}
99%{transform:translate(-20px);opacity:0;width:200%;height:100%;}
100%{transform:translate(-20px);opacity:0;width:1%;height:1%;}
}

@keyframes scroll_k_r{
0%{transform:translate(100px);opacity:0.2;width:200%;height:100%;}