beedesk / jQTouch

jQT + actively maintained + exclusive features (iPad layout, iscroll, tons of css enhancements, page events, param passing between pages, radio button, grid, mail, improved page history management etc.)
http://bit.ly/beedesk-jqt
MIT License
72 stars 13 forks source link

Problem with Ajax pages #11

Closed jermshaw closed 13 years ago

jermshaw commented 13 years ago

Your fork works great for the most part! Great job.

One problem I would love some help with is when I link to a page that is loaded via AJAX, the iscrolling functionality seems to be disabled on the page that was loaded.

Any ideas about how to get around this?

thomasyip commented 13 years ago

The best route will be having your code bind to the "link" (ie, ) or submit button which loads the AJAX. You can initialize iscroll there.

Take a look at the demos\main\index.html example.

wondermade commented 13 years ago

I'm having a similar problem. When I load dynamic content via AJAX, the content's height is wrong. So the scrolling doesn't work because it's forcing all the content into a short window. If I manually refresh the window through the console every resets and it works, but if I've tried binding the refresh to all sorts of places, but the refresh never seems to kick. (Console prints / alert in the binding will work, though.) Thoughts?

thomasyip commented 13 years ago

If your list is small, checkDOMChanges should work.

var scroll = new iScroll(contentid, {
desktopCompatibility: true,
bounce: true,
momentum: true,
checkDOMChanges: true
});