페이지를 나누다

3624 단어 페이지 나누기

/**
 *  
 * 
 * @param  
 */
function jumpPage(pageNo) {
	$("#pageNo").val(pageNo);
	$("#listForm").submit();
}

  // 
    function goPage(){
    	if($("#goPageNo").val()>=1){
    		if($("#goPageNo").val()<=$("#totalPage").val()){
    			jumpPage($("#goPageNo").val());
    		}else{
        		jumpPage($("#totalPage").val());
        	}
    	}else{
    		jumpPage(1);
    	}
    }

// 
  <input type="hidden" name="pageNo" id="pageNo" value="${pageData.pagination.pageNo}" />
 <input type="hidden" name="fieldName" id="fieldName" value="${pageData.compositor.fieldName}" />
<input type="hidden" name="compositorType" id="compositorType" value="${pageData.compositor.compositorType}" />
 <input type="hidden" name="totalPage" id="totalPage" value="${pageData.pagination.totalPage}" />

// 
<div class="pagination"> 
      <a href="javascript:jumpPage(1)" title="First Page">«  </a>
      <c:if test="${pageData.pagination.hasPrevPage}">  <a href="javascript:jumpPage(${pageData.pagination.prevPage})">«  </a> </c:if>
      <c:if test="${pageData.pagination.pageNo<=pageData.pagination.totalPage}">
      <a href="javascript:jumpPage(${pageData.pagination.pageNo})" class="number current" title="${pageData.pagination.pageNo}">${pageData.pagination.pageNo}</a>
      </c:if>
      <c:if test="${pageData.pagination.pageNo+1<=pageData.pagination.totalPage}">
       <a href="javascript:jumpPage(${pageData.pagination.pageNo+1})" class="number" title="${pageData.pagination.pageNo+1}">${pageData.pagination.pageNo+1}</a> 
      </c:if>
      <c:if test="${pageData.pagination.pageNo+2<=pageData.pagination.totalPage}">
       <a href="javascript:jumpPage(${pageData.pagination.pageNo+2})" class="number" title="${pageData.pagination.pageNo+2}">${pageData.pagination.pageNo+2}</a> 
     </c:if>
     <c:if test="${pageData.pagination.pageNo+3<=pageData.pagination.totalPage}">
      <a href="javascript:jumpPage(${pageData.pagination.pageNo+3})" class="number" title="${pageData.pagination.pageNo+3}">${pageData.pagination.pageNo+3}</a> 
     </c:if>
      <c:if test="${pageData.pagination.hasNextPage}"><a href="javascript:jumpPage(${pageData.pagination.nextPage})" title="Next Page">  »</a> </c:if>
       <a href="javascript:jumpPage(${pageData.pagination.totalPage})">  »</a>   <i class="color_red">${pageData.pagination.totalCount}</i>  
        <input type="text" id="goPageNo" name="goPageNo" value="" class="page">
        /${pageData.pagination.totalPage}
        <input type="reset" value="GO" onclick="javascript:goPage();" class="btn btn_gray go">
      </div>
    </div>
  </div>


좋은 웹페이지 즐겨찾기