I'm using apache cordova 2.2
jquery 1.7.2
jquery mobile 1.4.3
iscroll 5 (Matteo Spinelli ~ http://cubiq.org/)
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">
<!-- need scrollable list here -->
<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 display the scrollable page id="thisshouldscroll" as follows:
$.mobile.changePage( "#thisshouldscroll", { transition: "slideup"} );
buildScrollingData();
myScroll = new IScroll('#wrapper', {
mouseWheel: true,
scrollbars: true
});
Elsewhere i have 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 is not scrolling and I'm wondering if my initialization is screwed up somehow.
page id="thisshouldscroll" is displayed 2nd in my app.
Does anyone know the proper order to initialize iScroll 5 when its the 2nd page that should have the scrolling capabilities?
If the initialization is ok, can anyone suggest what I'm missing?
pagecontainershow
. You can for now usepageshow
event delegated to#thisshouldscroll
page. – Pyszka