I am using apache cordova 2.2
jquery 1.7.2 jquery mobile 1.4.3 iscroll 5 (Matteo Spinelli ~ http:
I have the following index.html:
<div data-role="page" id="id1"> <div data-role="header" data-position="fixed"> </div> <div data-role="content" id="id2"> </div> <div data-role="footer" data-position="fixed"> </div> </div> <div data-role="page" id="thisshouldscroll"> <div data-role="header" data-position="fixed"> <div id="buttondiv" data-role="navbar"> some buttons </div> </div> <div data-role="content" id="id4"> <div id="wrapper" > <div id="scroller"> </div> </div> </div> <div data-role="footer" data-position="fixed"> <div id="bottombuttondiv" data-role="navbar"> some buttons </div> </div> </div> <div data-role="page" id="id5"> <div data-role="header" data-position="fixed"> </div> <div data-role="content" id="id6"> </div> <div data-role="footer" data-position="fixed"> </div> </div>
I am showing the id = "thisshould scroll" scrollable page as follows:
$.mobile.changePage( "#thisshouldscroll", { transition: "slideup"} ); buildScrollingData(); myScroll = new IScroll('#wrapper', { mouseWheel: true, scrollbars: true });
In another place, I defined:
function displayScrollingData(){ var contentToAppend=""; //loop web service data add certain data to contentToAppend with contentToAppend = contentToAppend + str1 + "<BR>" + str2 + "<BR>" + str4 + "<BR>" + str3 + "<BR><BR>"; $("#scroller").append(contentToAppend); } function buildScrollingData(){ //call a web service, put results in an array dispayScrollingData() }
I also have:
function onLoad() { document.addEventListener("deviceready", onDeviceReady, false); document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false); }
The data does not scroll, and I wonder how my initialization is somehow screwed.
page id = "thisshouldscroll" appears 2nd in my application.
Does anyone know the correct initialization order of iScroll 5 when its second page should have scroll capabilities?
If the initialization is ok, can anyone suggest that I am missing?
user1126515
source share