iScroll gets stuck at the top of the page

593 views
Skip to first unread message

Mark Holmquist

unread,
Aug 2, 2011, 5:08:31 PM8/2/11
to iScroll
Hi,

I've been trying to get iScroll to work on a small app I'm designing.
The app works like so:

1. Page loads
2. RSS feed gets loaded, displayed
2a. AdMob loads
3. iScroll takes effect, should be able to scroll

I had to use iScroll to keep the admob div stationary, as I'm sure you
all know. My problem is, iScroll won't let me scroll down. I can move
it down a little, but it always pops back to the top when I let go.

Also, when I scroll with my cursor in the admob div, it moves the
entire screen (including the admob div). This happens in the iOS
simulator, on a device, *and* in a web browser, so I imagine it's not
device-or-SDK-specific. It's probably my own fault.

I am using the jQuery plugin (it's really just a wrapper), if that
makes any difference (though I only turned to the plugin after the
normal library wouldn't work for me).

Version: iScroll Lite base on iScroll v4.1.6
RSS feed reader: jquery.zrssfeed 1.1.2

General structure of page:

<div id="appBody">
<div id="feedResults">
<!-- feed gets loaded here, by zRSSfeed -->
</div>
</div>
<div id="appAdvertisements">
<!-- admob gets loaded here, by their JS file, I don't touch this -->
</div>

Loading code:

document.addEventListener('touchmove', function (e)
{ e.preventDefault();}, false);

$(document).ready(function() {
$('#feedResults').rssfeed('<<rssfeed-url>>', {
date: false,
header: false,
limit: 40,
snippet: false
}, function() {
$('#appBody').iscroll();
});

});


Any help is greatly appreciated, thanks!

Matteo Spinelli

unread,
Aug 3, 2011, 3:33:29 AM8/3/11
to isc...@googlegroups.com
first of all, get rid of the iscroll wrapper. there's no reason for using it.

then try to initiate the iScroll with a small delay:

setTimeout(function () {
iScroll('appBody'); }, 200);

M.

Mark Holmquist

unread,
Aug 10, 2011, 12:57:34 PM8/10/11
to iScroll
> first of all, get rid of the iscroll wrapper. there's no reason for using
> it.

Done, and you're right, I was just trying to make it simpler to
understand.

> then try to initiate the iScroll with a small delay:

Did that, but it just made it not work at all. As in, it doesn't
scroll at all now.

Mark Holmquist

unread,
Aug 10, 2011, 2:39:21 PM8/10/11
to iScroll
Update:

I have it to the point where it was before, without the wrapper and
with the iScroll loading after the RSS feed loads properly. Now, it
still sticks at the top of the page with no change from before.

I even made sure there were no errors on the page with Firebug, but
nothing doing, it still sticks.

This is very frustrating, is there any other suggestion anyone can
give?

Matteo Spinelli

unread,
Aug 11, 2011, 2:15:17 AM8/11/11
to isc...@googlegroups.com
try to init the iscroll inside the ready function (not the rssfeed). On ajax completion you should call myscroll.refresh() (maybe with a small delay as I suggested in the previous message)

M.

Mark Holmquist

unread,
Aug 12, 2011, 12:02:23 PM8/12/11
to iScroll
> try to init the iscroll inside the ready function (not the rssfeed). On ajax
> completion you should call myscroll.refresh() (maybe with a small delay as I
> suggested in the previous message)

Yeah, this is what I'm doing, but nothing is changing. Even when I run
myScroll.refresh() from a console it doesn't make it go below the page
limit. This is sort of disappointing....maybe the rss plugin does
something funny, though, so I'll keep debugging. Thanks.

Mark Holmquist

unread,
Aug 12, 2011, 1:01:46 PM8/12/11
to iScroll
> maybe the rss plugin does
> something funny, though, so I'll keep debugging. Thanks.

I tried switching to a different RSS parser, but no dice. It still
does funny business.

What could possibly be causing this?

Nagaraj Hubli

unread,
Aug 26, 2011, 11:58:33 AM8/26/11
to isc...@googlegroups.com
I had a similar issue as well, was able to fix by removing the height property for the <ul> inside wrapper container
Reply all
Reply to author
Forward
0 new messages