Results 1 to 3 of 3

Thread: Virtual Paging Script - Flat view and show all

  1. #1
    Join Date
    Jun 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Virtual Paging Script - Flat view and show all

    1) Script Title: Virtual Pagination Script
    2) Script URL (on DD):
    http://www.dynamicdrive.com/dynamici...pagination.htm

    3) Describe problem:

    since, DD doesnt support duplicate scripts on the same page, is there a way to also add a "show all" options to the "flat view"?

    I have the pagination working, with many pages, I would rather have the pagination numbering at top and bottom, but duplicating the script wont work.. so instead is there a way to put "show" all to the right of the "next" ?

    So basically, i give the user the options to view page by page or view all the page at once.


    thx

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Actually, this script does support duplicate instances of itself on the page, as do most newer scripts on DD. What you're asking is different, that is, how to duplicate the pagination interface for a pagination instance on both the top and bottom of the content. Right now there's no easy way, though I'll most likely add such a feature down the line.

    so instead is there a way to put "show" all to the right of the "next" ?
    Yep, that's certainly do-able. Add the below new function to the end of virtualpaginate.js:

    Code:
    virtualpaginate.prototype.showall=function(){
    for (var i=0; i<this.pieces.length; i++)
    this.pieces[i].style.display="block"
    }
    Then on your HTML page, within your pagination interface, you would call instance.showall() to show all contents at once:

    Code:
    <!-- Pagination DIV for Demo 4 -->
    <div id="galleryalt" class="paginationstyle" style="width: 300px; text-align: left">
    <a href="#" rel="previous"><</a> <span class="flatview"></span> <a href="#" rel="next">></a> <a href="javascript:gallery.showall()">All</a>
    </div>
    
    
    <!-- Initialize Demo 4 -->
    <script type="text/javascript">
    var gallery=new virtualpaginate("virtualpage4", 1)
    gallery.buildpagination("galleryalt", ["castle", "park", "harvest", "country"])
    </script>
    Last edited by ddadmin; 06-18-2007 at 09:10 PM.

  3. #3
    Join Date
    Jun 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    awesome thx! love DD!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •