initializing iscroll with phonegap and jQuery mobi

2019-09-15 17:06发布

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

2条回答
欢心
2楼-- · 2019-09-15 17:29

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

查看更多
smile是对你的礼貌
3楼-- · 2019-09-15 17:35

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.

查看更多
登录 后发表回答