Advanced Search

Results 1 to 2 of 2

Thread: Ajax Pagination Script small adjustment issue

  1. #1
    Join Date
    May 2007
    Location
    Timişoara, Romania
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Ajax Pagination Script small adjustment issue

    1) Script Title:
    Ajax Pagination Script

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

    I'm trying to place the "next" button near the "previous" button, before the numeral pagination links, instead of its current location to the right. But unfortunately and surprisingly for me, moving the javascript line that writes HTML output for the "next" button immediately after the "previous", doesn't work. I mean, it works fine, the button gets placed correctly, it just doesn't work any more
    I am moving this line
    Code:
    paginateHTML+='<li><a href="#next" rel="'+(selectedpage+1)+'">next </a></li>\n'
    immediately after this one
    Code:
    paginateHTML+='<li><a href="#previous" rel="'+(selectedpage-1)+'"></a></li>\n'
    Uhm.. help?

  2. #2
    Join Date
    Aug 2004
    Posts
    9,864
    Thanks
    3
    Thanked 960 Times in 949 Posts
    Blog Entries
    15

    Default

    The script assumes the "next" link is the last link within the pagination links. If you wish to move it so it's next to the "Prev" link (or 2nd place), you need to make the following two changes:

    1) Modify the HTML so the "next" button is physically moved:

    Code:
    paginateHTML+='<li><a href="#previous" rel="'+(selectedpage-1)+'"> Prev</a></li>\n<li><a href="#next" rel="'+(selectedpage+1)+'">next </a></li>\n'
    2), Then, modify the below lines within the script with the changes in red:

    Code:
    var prevlinkoffset=2
    paginatelinks[1].className=(selectedpage==this.pageinfo.page.length-1)? "prevnext disabled" : "prevnext"
    paginatelinks[1].setAttribute("rel", selectedpage+1)
    Attached is the final modified ajaxpagination.js file.

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
  •