div fake pagination principle: The total height of the div (1000px) displayed height (100px) After the fill is 10 pages. When the second page is viewed, the div height displayed is between 100-200 and so on.
See the page in the pages actually move the div scroll bar.
<div id= "Applications" > Display data collection </div>
<style>
#applications
{/
* width:500px; adjust the width/height:1592px of the display area/
* Adjust the high/font-size of the display area
: 14px;
margin-top:23px;
line-height:20px;
Overflow-pageindex:hidden;
Overflow-y: Hidden;
Word-break:break-all;
}
</style>
<script language= "JavaScript" >
var obj = document.getElementById ("Applications");//Get content layer
var pages = document.getElementById ("pages"); Gets the page
-Flip Layer window.onload = function ()//override form Loaded event
{
var allpages = Math.ceil (parseint (obj.scrollheight)/ parseint (obj.offsetheight)); Get number of pages
//pages.innerhtml = "<b> Total" + allpages-1+ "page </b>"; Number of output pages for
(var i = 1; I <= allpages i++) {
if (i = = 1) {
pages.innerhtml = "<a href=\" Javascript:sh Owpage (' + i + '); \ "> Home </a>";
}
else{pages.innerhtml + + "
<a href=\" javascript:showpage (' + i + "); \" > "+ i +" </a> ";
}
The loop outputs the first few pages
}
}
function ShowPage (pageINdex) {
obj.scrolltop = (pageINdex-1) * parseint ( Obj.offsetheight); According to the height, output the specified page
}
</script>
Dynamic Data paging, the last page is not enough page number, you need to fill the specific height, or pagination will be the previous pages of the data repeatedly displayed on the last page.