Reputation: 36947
I am having 2 issue with scrolling, and I can't seem to figure out the happy medium being new to appmobi development. Currently I have this bit of code..
var preventDefaultScroll = function(event) {
event.preventDefault();
window.scroll(0,0);
return false;
};
document.addEventListener('touchmove', preventDefaultScroll, false);
commenting these lines out the app doesn't scroll at all, commenting them out the app still doesnt scroll fully but lets me drag the whole app down so I can see my home screen behind the app. Anyone know a way to fix that?
Upvotes: 0
Views: 1227
Reputation: 719
The following code worked for me for scrolling.
var options = {
verticalScroll:true, //vertical scrolling
horizontalScroll:false, //horizontal scrolling
scrollBars:true, //display scrollbars
vScrollCSS : "jqmScrollbar", //CSS class for veritcal scrollbar
hScrollCSS : "jqmScrollbar" //CSS class for horizontal scrollbar
}
var scroller3 = $("#DivId").scroller(options);
You can set the scrolling="no" to the div you do not want to scroll.
Upvotes: 0
Reputation: 779
You'll want to get some code to scroll just a particular HTML element. Maybe take a look at how the jqMobi scrolling works (http://jqmobi.com). For an example of it in action, open up this URL in an HTML5 compliant browser like Chrome or Mobile Safari.
http://www.jqmobi.com/testdrive/#webslider
Upvotes: 1
Reputation:
That's not what is preventing you from "Scrolling". Look for the "touchmove" listener
Upvotes: 2