initializing iscroll with phonegap and jQuery mobile

吃可爱长大的小学妹 提交于 2019-12-24 19:23:07

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!