0

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?

chris
  • 36,115
  • 52
  • 143
  • 252

3 Answers3

2

That's not what is preventing you from "Scrolling". Look for the "touchmove" listener

1

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

profMobi
  • 779
  • 4
  • 14
  • I've since found that appMobi has a some type of UI AUX.js or something to that extent, cant remember off hand, but it ultimately allowed me a plug and play method of scrolling the screens while leaving the main screen in place. However it doesn't scroll so much as it drags, to which that would be fine, if it didnt drag left and right as well. Still trying to figure that one out, but its a step in the right direction. Still learning to understand appmobi though but liking it none the less. – chris Jul 18 '12 at 18:30
0

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.

Himanshu
  • 31,810
  • 31
  • 111
  • 133
AppMobiGurmeet
  • 719
  • 3
  • 6