I'm setting up an under construction page for my new website.
I'll try to explain:
- There are 3 Columns side by side
- When a new comment is 'retrieved' it is added to the first column
- For each comment - if bottom > 300px from top of column: copy, delete and prepend to next column (just delete if column:last)
The above I have working fine, but riddle me this:
- How can I do the opposite and add older comments to the end
- A comment can vary in height depending on the message, this means there isn't a fixed amount of comments on show.
- There are 'newer comments' and 'older comments' links. I would like these to retrieve comments posted after or before the newest comment shown or oldest comment shown respectively.
The idea is to repeat the 'retrieve comment' procedure 6 times, getting 6 newer/older comments and prepending/appending to the first/last column respectively. I would need to keep track of the newest comment and oldest comment being displayed for the php script to know which comment to retrieve next (returned via AJAX).
I may have over complicated things but it would be fantastic if anyone can just come up with a solid algorithm for me to follow. I'm not asking anyone to program it for me, that would take the fun out! ;D
My attempt at a drawing: