views:

34

answers:

1

Hi Folks,

how do I check whether the scrollbar is at the beginning or end with jquery? For the beginning part i would check if $(window).scrollTop <= 0, but what should i use for the end?

Thank you

+1  A: 

Use this:

($(window).scrollTop() + $(window).height() >= $(document).height())
Matt Ball
Nice one - thank you.
Margaret
@Margaret: you're welcome.
Matt Ball