问题
I have built a project using phonegap and jquery mobile, and have iscroll working perfectly on the first page. However on my second page iscroll isn't running. Can someone tell me how you initialize a jquery script on the page in JQM? I am new to both platforms and think it may be a simple mistake! Thanks
回答1:
I never used phonegap, but im building a JQM-webapp as well, so i hope this works for you.
iScroll seems to cause several problems trying to implement it in JQM. This is why they came up with jquery.mobile.iscrollview which bascically adapts the iScroll javascript to the jQuery Mobile environment.
Just include the script and add data-iscroll=""
to your div. And include all of your scripts in the given order.
回答2:
checkDOMChanges: set to false to prevent auto refresh on DOM changes. If you switch off this feature you have to call iScroll.refresh() function programmatically every time the DOM gets modified. If your code makes many subsequent DOM modifications it is suggested to set checkDOMChanges to false and to refresh the iScroll only once (ie: when all changes have been done). Default true.
see more on there page:http://cubiq.org/iscroll
来源:https://stackoverflow.com/questions/14348530/initializing-iscroll-with-phonegap-and-jquery-mobile