效果图:

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

 

 

 

<div  >
		  			<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>

 

相关文章:

  • 2022-02-09
  • 2021-11-23
  • 2021-11-23
  • 2021-12-03
  • 2021-11-18
  • 2022-01-11
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-03
  • 2021-05-29
  • 2021-12-03
  • 2021-09-24
  • 2022-12-23
相关资源
相似解决方案