zippy1978 / jquery.scrollz

Modern scrolling for jQuery
GNU General Public License v2.0
81 stars 17 forks source link

Bottomreached event firing immediately after scrollz initialized. #12

Open bryantAXS opened 11 years ago

bryantAXS commented 11 years ago

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?

bryantAXS commented 11 years ago

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);
zippy1978 commented 11 years ago

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