Hi i have a window which is a bit like this : http://d.pr/i/r8m1
As you can see, the sidebar and the header remains static, while the comments window can be scrolled. Data is appended when the user scrolls to the end of the window.
I am using codeigniter, so i append paginated data and kept a counter to increment by the number of paginated data each time the end of the window is reached.
Each comment has a comment id, for example #S334 is an id associated with the latest comment. The comments can be in any paginated page such that the first 20 comments will be in the first paginated window like this: http://site.com/. The next 20 comments will be in the second paginated page like this: site.com/20 and so on.
I want to give the user the option to scroll to any comment. I guess i will have to use the .scroll() function.
I tried this:
$('#S344').scroll();
and it didn’t work.
Any help please?
What you’re doing is just triggering the scroll event on the element with that id, not actually scrolling the page to that element.
I believe what you’re looking for is scrollTo() which lets you actually specify the target that you want the page to scroll to. See this page for more information: http://demos.flesler.com/jquery/scrollTo/