SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Addict
    Join Date
    Sep 2006
    Posts
    238
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    infinite scrolling

    Hello

    I am working on an infinite scrolling script. At the moment I am displaying a set of results with the limit set to 10.

    When the user scrolls to the end of the page, it will execute another query. In this query how can I display the next ten results?

    e.g

    10 results
    \/
    scroll down
    \/
    next 10 results
    \/
    scroll down
    \/
    next 10 results

  2. #2
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,508
    Mentioned
    163 Post(s)
    Tagged
    4 Thread(s)

  3. #3
    SitePoint Addict
    Join Date
    Sep 2006
    Posts
    238
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello I understand using offsets using LIMIT 10, 10 however, how when the user scrolls down to the next set it would have to be 20,10 and then 30,10 etc
    How would I automatically change that?

  4. #4
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,508
    Mentioned
    163 Post(s)
    Tagged
    4 Thread(s)
    If you want to automatically load the next set when the user scrolls down, you'll have to use javascript. And you'll use javascript to send the offset to the PHP script.

  5. #5
    SitePoint Zealot Sogo7's Avatar
    Join Date
    May 2011
    Posts
    129
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    There's a good example of javascript being used to create infinite scrolling
    over at nijol.x10.mx that may be of some use.


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
  •