On Aug 5, 11:32 pm, David Millar <
davmil...@gmail.com> wrote:
> I'm working on a mobile version of my company's social platform and I'm
> loving iScroll for the ability to use a fixed header and footer.
>
> For some reason, iScroll doesn't want to let me scroll to the bottom of
> pages. For example, onhttp://
www.hellolife.net/mobile/profile.php?userid=45127the content
> finishes scrolling after the first "5 Awesome Things" item, but there are 4
> more items below it. I can partially see them but pulling up on the page
> with my finger, but it snaps back to that point right below item #1 every
> time. This is happening on many other pages on the mobile site but at
> various different locations/amounts of cut-off stuff.
>
> Anyone have any ideas what I'm doing wrong and how I can remedy it?
>
> Thanks in advance!
Hi David,
You should check to see if your scroller dimensions exceed your
wrapper dimensions. iScroll works out how much it can scroll based on
that calculation. The code is found in the refresh() method and uses
wrapper.clientHeight, scroller.offsetHeight, scroller.offsetBottom and
scroller.offsetTop. I find that sometimes these values are not set or
set to zero.
If that is the case then you could find the actual height of the
scroller by using getComputedStyle() and set the height of the
scroller directly before refreshing iScroll. As an example, assume
that your scroller has an id of "myScroller" the code would look like:
var element = document.getElementById("myScroller");
element.style.height =
document.defaultView.getComputedStyle(element,"").getPropertyValue("height");
Hope this helps,
Hunlon.