View Full Version : virtualpagination and adding a view all option

02-17-2010, 06:59 PM
1) Script Title: Virtual Pagination script v2.1

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/virtualpagination.htm

3) Describe problem: playing with this script and i am having issues trying to add a "view all" option so that it will do just that. i am not that good with JS coding and its hard to wrap my mind around it but if i could get a hint on to what to look for or the answer that would be nice. thank you

02-17-2010, 10:13 PM
Try the below attached modified .js file. Then, use a link like the code in red below to add a "show all" option:

<!-- Pagination DIV for Demo 1 -->
<div id="gallerypaginate" class="paginationstyle">
<a href="#" rel="previous">Prev</a> <span class="flatview"></span> <a href="#" rel="next">Next</a>

<!-- Initialize Demo 1 -->
<script type="text/javascript">

var gallery=new virtualpaginate({
piececlass: "virtualpage", //class of container for each piece of content
piececontainer: 'div', //container element type (ie: "div", "p" etc)
pieces_per_page: 1, //Pieces of content to show per page (1=1 piece, 2=2 pieces etc)
defaultpage: 0, //Default page selected (0=1st page, 1=2nd page etc). Persistence if enabled overrides this setting.
wraparound: false,
persist: false //Remember last viewed page and recall it when user returns within a browser session?

gallery.buildpagination(["gallerypaginate", "gallerypaginate2"])


<a href="javascript:gallery.navigate(2)">Go to 3rd page within "gallery"</a>
<br />

<a href="javascript:gallery.showall()">Show all</a>