首页 > Web开发 > 详细

jstl+bootstrap-2.2.1分页组建 ------- 第一版

时间:2014-02-11 17:13:11      阅读:409      评论:0      收藏:0      [点我收藏+]

效果图:

bubuko.com,布布扣

 

 

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<div id="paging" class="pagination pagination-right" >
                    <ul>
                        <c:choose>
                        <c:when test="${pageBean.currentPage > 1}">
                            <li><a href="javascript:changePage(${pageBean.currentPage-1 });"><i class="icon-fast-backward"></i></a></li>
                        </c:when>
                        </c:choose>
                         
                         
                        <c:choose>
                        <c:when test="${pageBean.pageCounts != 1}">
                            <c:if test="${pageBean.currentPage==1}">
                            <li><a style="background-color: #FFFADA;">1</a></li>
                            </c:if>
                            <c:if test="${pageBean.pageCounts!=null and pageBean.currentPage!=1}">
                            <li><a href="javascript:changePage(1);">1</a></li>
                            </c:if>
                        </c:when>
                        <c:when test="${pageBean.pageCounts == 1}">
                            <li><a style="background-color: #FFFADA;");">${pageBean.pageCounts}</a></li>
                        </c:when>
                        </c:choose>
                         
                         
                         
                        <c:forEach begin="1" end="${pageBean.pageCounts}" varStatus="i">
                            <c:choose>
                            <c:when test="${pageBean.currentPage ==i.index and pageBean.currentPage!=pageBean.pageCounts and pageBean.currentPage!=1}">
                                <li><a style="background-color: #FFFADA;">${i.index } </a></li>
                            </c:when>
                            <c:otherwise>
                            <!-- 左侧 -->
                            <c:if test="${pageBean.currentPage > 4 and pageBean.currentPage - i.index<4 and pageBean.currentPage >i.index}">
                                <li><a href="javascript:changePage(${i.index });">${i.index } </a></li>
                            </c:if>
                            <c:if test="${pageBean.currentPage < 5 and pageBean.currentPage - i.index<3 and pageBean.currentPage > i.index and  i.index > 1}">
                                <li><a href="javascript:changePage(${i.index });">${i.index } </a></li>
                            </c:if>
                            <!-- 右侧 -->
                            <c:if test="${pageBean.pageCounts-pageBean.currentPage>4 and i.index - pageBean.currentPage <4 and i.index> pageBean.currentPage }">
                                <li><a href="javascript:changePage(${i.index });">${i.index } </a></li>
                            </c:if>
                            <c:if test="${pageBean.pageCounts-pageBean.currentPage<5 and i.index - pageBean.currentPage <3 and i.index> pageBean.currentPage and i.index<pageBean.pageCounts }">
                                <li><a href="javascript:changePage(${i.index });">${i.index } </a></li>
                            </c:if>
                            </c:otherwise>
                            </c:choose>
                        </c:forEach>
                         
                        <c:choose>
                        <c:when test="${pageBean.pageCounts != 1}">
                            <c:if test="${pageBean.pageCounts!=null and pageBean.currentPage==pageBean.pageCounts}">
                            <li><a style="background-color: #FFFADA;">${pageBean.pageCounts}</a></li>
                            </c:if>
                            <c:if test="${pageBean.pageCounts != 0 and pageBean.currentPage!=pageBean.pageCounts}">
                            <li><a href="javascript:changePage(${pageBean.pageCounts});">${pageBean.pageCounts}</a></li>
                            </c:if>
                        </c:when>
                        </c:choose>
                         
                         
                        <c:if test="${pageBean.pageCounts != 0 and pageBean.currentPage != pageBean.pageCounts}">
                            <li><a href="javascript:changePage(${pageBean.currentPage+1 });"><i class="icon-fast-forward" ></i></a></li>
                        </c:if>
                    </ul>
                </div>

jstl+bootstrap-2.2.1分页组建 ------- 第一版

原文:http://www.cnblogs.com/xuzhenmin/p/3544014.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!