[jQuery] Re: Infinite Scroll within a div element - How detect relative scroll position?

2008-09-29 Thread ricardobeat
$('#content')[0].scrollHeight will give you the inner height of the DIV. When scrollTop + height >= scrollHeight you are near the end of the DIV. That's a rough calculation: borders, margins, paddings and the alignment of the planets can affect it. $.fn.isNearTheEnd = function() { return t

[jQuery] Re: Infinite Scroll within a div element - How detect relative scroll position?

2008-09-29 Thread [EMAIL PROTECTED]
On Sep 28, 10:54 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > How can I detect when the user has scrolled near the end of a div with > a scroll bar so that I can add more content? > > I tried something like this: > > $('div#content').scroll(function(){ > if ($('div#content').

[jQuery] Re: Infinite Scroll within a div element - How detect relative scroll position?

2008-09-29 Thread [EMAIL PROTECTED]
If it helps, I believe this is the source code for the scrollTop method but I can't quite decipher what's going on. Could someone interpret it for me, just to tell me what the value means that it returns when it acts on a div? // Create scrollLeft and scrollTop methods jQuery.each( ['Left', 'To

[jQuery] Re: Infinite Scroll within a div element - How detect relative scroll position?

2008-09-29 Thread [EMAIL PROTECTED]
Any thoughts on this? Anyone? I'm completely stuck. -Greg On Sep 28, 10:54 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > How can I detect when the user has scrolled near the end of a div with > a scroll bar so that I can add more content? > > I tried something like this: > > $('div#con