Results 1 to 4 of 4

Thread: Virtual Pagination Script URGENT HELP NEEDED !

  1. #1
    Join Date
    Jan 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Virtual Pagination Script URGENT HELP NEEDED !

    Virtual Pagination Script

    http://www.dynamicdrive.com/dynamici...pagination.htm

    I have installed the script and it is works great. But I need to name my links, instead of the script automatically naming the links 1,2,3 etc., I would like to name them accordingly, like "home" "about us" etc.,

    Does anyone have any Idea how to achieve this?

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    That's not exactly how the script is designed.... it does a certain amount of blocks per 'page'. However, seems logical enough.

    In the .js file, this line (about 1/3 down the page, perhaps) needs to be updated:
    Code:
    virtualpaginate.prototype.paginate_build_selectmenu=function(paginatedropdown){
    var instanceOfBox=this
    this.selectmenupresent=1
    for (var i=0; i<this.pagecount; i++)
    paginatedropdown.options[i]=new Option("Page "+(i+1)+" of "+this.pagecount, i)
    paginatedropdown.selectedIndex=this.currentpage
    paginatedropdown.onchange=function(){
    instanceOfBox.showpage(this.selectedIndex)
    }
    }
    That makes each option for the select menu. Page # of total#.
    So.... Option("Home") would make ALL of them home.

    One possible idea would be to try an array like this:
    Code:
    var pagenames = new Array("home", "links", "contact" )
    virtualpaginate.prototype.paginate_build_selectmenu=function(paginatedropdown){
    var instanceOfBox=this
    this.selectmenupresent=1
    for (var i=0; i<this.pagecount; i++)
    paginatedropdown.options[i]=new Option(pagenames[i], i)
    paginatedropdown.selectedIndex=this.currentpage
    paginatedropdown.onchange=function(){
    instanceOfBox.showpage(this.selectedIndex)
    }
    }
    (Add the first line, replace the line above with the second line.)

    I'm pretty sure that should work for you.

    It creates an array, so make sure that the number of 'pages' matches the titles in the array.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    Wow, Never seen you work in the DD scripts area before
    Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
    Currently: enjoying the early holidays :)
    Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide

  4. #4
    Join Date
    Mar 2007
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hello,

    I'm using "Demo 1" of this script. Is there any way to set up this Array modification mentioned in djr33's code for Demo 1 of this script? (Currently this fix is using the dropdown demo, or "Demo 3")

    Thanks for your help!

    Dan

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
  •