Results 1 to 5 of 5

Thread: help needed with Virtual Pagination in dynamic pages

  1. #1
    Join Date
    Feb 2007
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default help needed with Virtual Pagination in dynamic pages

    1) Script Title: Dynamic Ajax Content & Virtual Pagination Script

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...jaxcontent.htm
    http://www.dynamicdrive.com/dynamici...pagination.htm

    3) Describe problem: i've used the virtual pagination script together with the Dynamic Ajax Content but i can't make them work together: when i load some dynamic content (from a mysql db using php) in a div with the ajaxcombo function nothing happens. It's like if the loaded page can't invoke the function to activate the pagination.

    Is it possible to call a function loaded via ajax?

    This is the page i'm worknig on:

    http://office.azero.it/fitoben.it/prodotti/prodotti.php

    thanks vitto

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

    Default

    In their present states it's difficult to get the two to work together. The Virtual Pagination script is meant to paginate content already on the page. An easier and better approach IMO is to simply use PHP to output all the content when the page loads, but segmented using the Virtual Pagination script (just wrap each piece of content in its special DIV). To the end user, he/she will still only see one piece of content at a time, and can paginate between contents.

  3. #3
    Join Date
    Feb 2007
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    i managed to make them work. The basics are as you said but i still need to make the php work, which is not up to me. I'll see in the next days and eventually i'll post my solution, it could be useful.

    Thanks
    vitto

  4. #4
    Join Date
    Feb 2007
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    no i got another little problem...
    i'd like my pagination links stop when they reach the last div and not to show the contents all over again. What could i do?

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

    Default

    Regarding getting the "Previous" and "Next" pagination links to not wrap, just find the lines:

    Code:
    if (keyword=="previous")
    this.currentpage=(this.currentpage>0)? this.currentpage-1 : (this.currentpage==0)? this.pagecount-1 : 0
    else if (keyword=="next")
    this.currentpage=(this.currentpage<this.pagecount-1)? this.currentpage+1 : 0
    inside the .js file, and change it to:

    Code:
    if (keyword=="previous")
    this.currentpage=(this.currentpage>0)? this.currentpage-1 : 0
    else if (keyword=="next")
    this.currentpage=(this.currentpage<this.pagecount-1)? this.currentpage+1 : this.pagecount-1

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
  •