zippy1978/jquery.scrollz

Bottomreached event firing immediately after scrollz initialized.

Opened this issue · 2 comments

I'm using the jquery mobile auto-loading and I have a content div with the height of about 730 pixels. When the page loads the bottomreached event is firing and I am unable to scroll further down the page.

On line 674 of the plugin I see that there is a check to tell when you hit the bottom, I'm wondering if that math is incorrect? When I console.log out the params used to determine if we're at the bottom I get

container.scrollTop(): 133
container.height(): 730
detectionOffset: 86.3
container.get(0).scrollHeight: 893

The math makes sense why it would be hitting the bottom but obviously something must be incorrect as I'm at the top of the page... Any thoughts?

I got it to work when I set the content container's height to the height of the window, but I'm thinking this probably isn't the correct way of solving the issue.

$content_container.scrollz('height', $(window).height() - 55);

Hi,
The event is fired when you are 10% before the bottom of your content by default (see bottomDetectionOffset option).