Ecnarongi
05-28-2008, 11:05 AM
Script: Virtual Pagination
http://www.dynamicdrive.com/dynamicindex17/virtualpagination.htm
I am using a table to display the contents of my search results. My tr tags hold the class which is used to paginate the contents.
<div style="width: 400px; height: 84px">
<table>
<tr class="funkypage6">
<td>First Piece within Content</td>
</tr>
<tr class="funkypage6">
<td>Second Piece within Content</td>
</tr>
<tr class="funkypage6">
<td>Third Piece within Content</td>
</tr>
<tr class="funkypage6">
<td>Fourth Piece within Content</td>
</tr>
<tr class="funkypage6">
<td>Fifth Piece within Content</td>
</tr>
<tr class="funkypage6">
<td>Sixth Piece within Content</td>
</tr>
<tr class="funkypage6">
<td>Seventh Piece within Content</td>
</tr>
<tr class="funkypage6">
<td>Eighth Piece within Content</td>
</tr>
</table>
</div>
<div id="tableDiv" class="paginationstyle">
<a href="#" rel="previous">Prev</a> <span class="flatview"></span> <a href="#" rel="next">Next</a>
</div>
<script type="text/javascript">
//virtualpaginate(className, pieces_to_show_per_page)
var pagecontent=new virtualpaginate("funkypage6", 2, "tr")
pagecontent.buildpagination("tableDiv")
</script>
Every time I click on the next or prev buttons the contents jump all over the page. I did as the author of the script suggested and wrapped a div around the contents but no dice. I would like to know if anyone has had a similar problem or can provide me with a clue as to it's solution.
http://www.dynamicdrive.com/dynamicindex17/virtualpagination.htm
I am using a table to display the contents of my search results. My tr tags hold the class which is used to paginate the contents.
<div style="width: 400px; height: 84px">
<table>
<tr class="funkypage6">
<td>First Piece within Content</td>
</tr>
<tr class="funkypage6">
<td>Second Piece within Content</td>
</tr>
<tr class="funkypage6">
<td>Third Piece within Content</td>
</tr>
<tr class="funkypage6">
<td>Fourth Piece within Content</td>
</tr>
<tr class="funkypage6">
<td>Fifth Piece within Content</td>
</tr>
<tr class="funkypage6">
<td>Sixth Piece within Content</td>
</tr>
<tr class="funkypage6">
<td>Seventh Piece within Content</td>
</tr>
<tr class="funkypage6">
<td>Eighth Piece within Content</td>
</tr>
</table>
</div>
<div id="tableDiv" class="paginationstyle">
<a href="#" rel="previous">Prev</a> <span class="flatview"></span> <a href="#" rel="next">Next</a>
</div>
<script type="text/javascript">
//virtualpaginate(className, pieces_to_show_per_page)
var pagecontent=new virtualpaginate("funkypage6", 2, "tr")
pagecontent.buildpagination("tableDiv")
</script>
Every time I click on the next or prev buttons the contents jump all over the page. I did as the author of the script suggested and wrapped a div around the contents but no dice. I would like to know if anyone has had a similar problem or can provide me with a clue as to it's solution.