Maybe someone else will have a better idea, but the first thing that comes
to mind is to grab the div via ajax, measure the height, then append it and
use scrollBy to scroll the view the same amount as the height of the div.
 The trickier part would be keeping track of the current scroll position
with each insert and making sure it's updated with each scroll event so the
current content is always in view.

On Mon, Apr 9, 2012 at 9:54 PM, Paul Menard <[email protected]> wrote:

> Greetings all. Working on a project where I have a fixed height outer
> wrapper div. Then within the div I have other div elements in a list. I've
> setup the JS to pull in new items from the server via AJAX. new items
> retrieved via AJAX are prepend top of the list. This is sort of like a
> realtime log events. The AJAX and prepend are working but when the prepend
> happens the item(s) are immediately visible. I want to prepend but keep the
> top of the list items hidden. Then let the user scroll to the new items.
>
> So for example the height of the wrapper div is 450px. And there are
> initially 50 items in the list. So the wrapper div will scroll. Visible at
> the time are items 50-41 to top 10 items of the list. The other 40 items
> are below the scroll area. The AJAX call fires and pulls in 10 new items
> 51-60 which are prepended to the top of the listing. I want to just perform
> the prepend but keep the current visible items showing items 50-41.
>
> I've tried the outer wrapper as <ul> and list items <li></li> still did
> not work.
>
> Thoughts?
>
> P-
>
> --
> Our Web site: http://www.RefreshAustin.org/
>
> You received this message because you are subscribed to the Google Groups
> "Refresh Austin" group.
>
> [ Posting ]
> To post to this group, send email to [email protected]
> Job-related postings should follow http://tr.im/refreshaustinjobspolicy
> We do not accept job posts from recruiters.
>
> [ Unsubscribe ]
> To unsubscribe from this group, send email to
> [email protected]
>
> [ More Info ]
> For more options, visit this group at
> http://groups.google.com/group/Refresh-Austin
>

-- 
Our Web site: http://www.RefreshAustin.org/

You received this message because you are subscribed to the Google Groups 
"Refresh Austin" group.

[ Posting ]
To post to this group, send email to [email protected]
Job-related postings should follow http://tr.im/refreshaustinjobspolicy
We do not accept job posts from recruiters.

[ Unsubscribe ]
To unsubscribe from this group, send email to 
[email protected]

[ More Info ]
For more options, visit this group at 
http://groups.google.com/group/Refresh-Austin

Reply via email to