function goPage(pno,psize){ var itable = document.getElementById("idData"); var num = itable.rows.length;//表格行数 var totalPage = 0;//总页数 var pageSize = psize;//每页显示行数 if((num-1)/pageSize > parseInt((num-1)/pageSize)){ totalPage=parseInt((num-1)/pageSize)+1; }else{ totalPage=parseInt((num-1)/pageSize); } var currentPage = pno;//当前页数 var startRow = (currentPage - 1) * pageSize+1;//开始显示的行 var endRow = currentPage * pageSize+1;//结束显示的行 endRow = (endRow > num)? num : endRow; //前三行始终显示 for(i=0;i<1;i++){ var irow = itable.rows[i]; irow.style.display = "block"; } for(var i=1;i<num;i++){ var irow = itable.rows[i]; if(i>=startRow&&i<endRow){ irow.style.display = "block"; }else{ irow.style.display = "none"; } } var pageEnd = document.getElementById("pageEnd"); var tempStr = ""; if(currentPage>1){ tempStr += "<a href="https://www.jb51.net/" mce_href="https://www.jb51.net/""#/" onmouseover=https://www.jb51.net/"MM_swapImage('Image69','','images/back_buttom01_dowm.jpg',1)/" onClick=https://www.jb51.net/"goPage("+(currentPage-1)+","+psize+")/"><img src="https://www.jb51.net/" mce_src="https://www.jb51.net/""images/back_buttom01.jpg/" /></a> " }else{ tempStr += "<a href="https://www.jb51.net/" mce_href="https://www.jb51.net/""#/" onmouseover=https://www.jb51.net/"MM_swapImage('Image69','','images/back_buttom01_dowm.jpg',1)/"><img src="https://www.jb51.net/" mce_src="https://www.jb51.net/""images/back_buttom01.jpg/" /></a> "; } for (var i = 1; i <= totalPage; i++) { if (i == currentPage) { tempStr += i+" "; } else { tempStr += "<a href="https://www.jb51.net/" mce_href="https://www.jb51.net/""#/" onClick=https://www.jb51.net/"goPage("+(i)+","+psize+")/">"+i+"</a> " } } if(currentPage<totalPage){ tempStr += "<a href="https://www.jb51.net/" mce_href="https://www.jb51.net/""#/" onmouseout=https://www.jb51.net/"MM_swapImgRestore()/" onmouseover=https://www.jb51.net/"MM_swapImage('Image68','','images/next_buttom01_dowm.jpg',1)/" onClick=https://www.jb51.net/"goPage("+(currentPage+1)+","+psize+")/"><img src="https://www.jb51.net/" mce_src="https://www.jb51.net/""images/next_buttom01.jpg/" /></a> "; }else{ tempStr += "<a href="https://www.jb51.net/" mce_href="https://www.jb51.net/""#/" onmouseout=https://www.jb51.net/"MM_swapImgRestore()/" onmouseover=https://www.jb51.net/"MM_swapImage('Image68','','images/next_buttom01_dowm.jpg',1)/"><img src="https://www.jb51.net/" mce_src="https://www.jb51.net/""images/next_buttom01.jpg/" /></a> "; } tempStr +="<a href="https://www.jb51.net/" mce_href="https://www.jb51.net/""#top/" onmouseout=https://www.jb51.net/"MM_swapImgRestore()/" onmouseover=https://www.jb51.net/"MM_swapImage('Image20','','images/top_buttom01_dowm.jpg',1)/"><img src="https://www.jb51.net/" mce_src="https://www.jb51.net/""images/top_buttom01.jpg/" /></a>"; document.getElementById("barcon").innerHTML = tempStr; } var base='<%=base%>'; window.onload = function(){ goPage(1,10); } <div></div>
温馨提示:js代码中上一页 下一页定义的图片根据自己需求可以改的