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

On the 'loaded()', 'setTimeout' and scrollRefresh #10

Closed notfair closed 13 years ago

notfair commented 13 years ago

I want to know why it has nested 'setTimeout' function? The weird thing is when I use your example, the scroll everything was fine, but when I add in some content, the scroll no longer work, but if I reduce the nested 'setTimeout', then it can work.

Btw, how should I force refresh the scroll panel? using $(window).resize()?

I might have dynamic data come in therefore it is good to has a trigger for the scroll panel, how should I trigger the scroll.refresh? by using the pageAnimationEnd?

thomasyip commented 13 years ago

Free feel to adjust the setTimeout() in your code. It was more robust to have a timeout, because a lot of content tend to be load during $(document).read().

If you want iscroll to refresh itself, initialize it with the following might save you some code: checkDOMChanges: true

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