| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
- <%-- <%@include file="/context/mytags.jsp"%> --%>
- <link rel="stylesheet" href="plug-in/ace/css/bootstrap.css" />
- <!-- <link rel="stylesheet" href="plug-in/easyui/themes/metrole/pagination.css"> -->
- <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
- <script src="plug-in/tools/jquery.pagination.js"></script>
- <script type="text/javascript" src="plug-in/ace/js/bootstrap.js"></script>
- <!DOCTYPE html >
- <div class="row"></div>
- <div class="tc mt15">
- <div id="Pagination" class="pagination">这里显示分页</div>
- </div>
- <style>
- .col-md-3{
- width:14%;
- }
- .img-responsive, .thumbnail > img, .thumbnail a > img, .carousel-inner > .item > img, .carousel-inner > .item > a > img{
- width: 100%;
- height: 15%;
- }
- </style>
- <script type="text/javascript">
- var pageSize =12; //每页显示多少条记录
- var total=${total}; //总共多少记录
- $(function() {
- Init(0); //注意参数,初始页面默认传到后台的参数,第一页是0;
- console.log($.fn.jquery);//jquery-1的版本号
- console.log($.fn.pagination);//pagination扩展函数
- $("#Pagination").pagination(total, {
- callback: PageCallback,
- prev_text: '上一页',
- next_text: '下一页',
- items_per_page: pageSize,
- num_display_entries: 6, //连续分页主体部分显示的分页条目数
- num_edge_entries: 1, //两侧显示的首尾分页的条目数
- });
- function PageCallback(index, jq) { //前一个表示您当前点击的那个分页的页数索引值,后一个参数表示装载容器。
- Init(index);
- }
- });
-
- function Init(pageIndex){ //这个参数就是点击的那个分页的页数索引值,第一页为0,上面提到了,下面这部分就是AJAX传值了。
- $.ajax({
- type: "post",
- url:"PersonalFileController.do?getimagelist&rows="+pageSize+"&page="+pageIndex,
- async: false,
- dataType: "json",
- success: function (data) {
- $(".row").empty();
- var array = data;
- for(var i=0;i<array.length;i++){
- var info=array[i];
-
- if(info.accUrl != null){
- $(".row").append('<div class="col-sm-6 col-md-3"><div class="thumbnail"><img src="'+info.accUrl
- +'" alt="通用的占位符缩略图"> '
- +'<div class="caption"> '
- +'<h5>上传时间</h5> '
- +'<p>'+info.createtime+'</p> <p>'
- +' <a href="#" class="btn btn-primary" role="button">下载 </a>'
- +' <a href="#" class="btn btn-default" role="button">删除 </a>'
- +'</p></div></div></div>') ;
- }
- }
- },
- error: function () {
- alert("请求超时,请重试!");
- }
- });
- };
- </script>
|