Load AJAX pages, JQT Scroll problem

134 views
Skip to first unread message

Bruno M.

unread,
Feb 21, 2011, 10:16:39 AM2/21/11
to jQTouch
Hi all,
i'm using the JQT Scroll plugin (http://code.google.com/p/jqtscroll/)
and it works very good.
If i load a page via Ajax, the scrolling behaviours doesn't work once
the page is correctly loaded.
This i think because it miss the application initialization on each
div with class .scroll

$('.scroll').each(function(scroller) {
scrollers[scroller] = new TouchScroll(this, {elastic: true});
});

How can i trigger this initialization after this page is loaded via
ajax?

Thanks!

bruno

Bruno M.

unread,
Feb 21, 2011, 10:23:43 AM2/21/11
to jQTouch
Fixed, in the function ShowPageByHref inside jqtouch.js, find this
line:
settings.$referrer.attr('href', '#' + firstPage.attr('id'));

and add this line above:
new TouchScroll(document.querySelector('#' + firstPage.attr('id')),
{elastic: true});


Bruno

noods

unread,
Feb 22, 2011, 8:34:49 AM2/22/11
to jQTouch
Hi Bruno,

How did you manage to fix this? I'm getting the same problem where the
Ajax load doesn't scroll.
I tried your fix method, but all I get is a blank screen when the page
loads.

thanks

- noods

Bruno M.

unread,
Feb 24, 2011, 3:56:41 AM2/24/11
to jQTouch

Adding line:
new TouchScroll(document.querySelector('#' + firstPage.attr('id')),
{elastic: true});
the page is correctly displayed even if the toolbar is no more in
fixed posistion: it scrolls with the entire page. So it's not a
complete fix of the problem but it's ok in this project where i just
load that single page via AJAX.
If i'm going to fix it in the next days, i'll post a solution.

bye

bruno

WienerDog

unread,
Jun 14, 2013, 12:07:03 PM6/14/13
to jqt...@googlegroups.com
I was having this same issue and found this that helped me out immensely: https://github.com/senchalabs/jQTouch/issues/390

Specifically, adding this after my AJAX call returned:

    $('body').height($('div.current').height());
Reply all
Reply to author
Forward
0 new messages