Question

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?

Was it helpful?

Solution

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

OTHER TIPS

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

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top