user1759671
user1759671

Reputation: 93

PhoneGap Android + jQuery mobile app does not scroll down

I have a div that expands on touch, but when it expands it does not scroll to the expanded parts. I noticed this problem with Android devices running 2.3.3, this also happens on the older Iphone. I'm pretty sure it's a CSS problem.

Does anyone have any idea?

Upvotes: 0

Views: 973

Answers (1)

user1759671
user1759671

Reputation: 93

Older android phones and older IOS does not support scrolling in divs: Use this function to scroll the element that you want to scroll:

function TouchScroll(elem){

// alert("listening");

var scrollStartPos=0;

elem.addEventListener("touchstart", function(event) {

                      scrollStartPos=this.scrollTop+event.touches[0].pageY;

                      // event.preventDefault();

                      },false);

elem.addEventListener("touchmove", function(event) {

                      this.scrollTop=scrollStartPos-event.touches[0].pageY;

                       event.preventDefault();

                      },false);   

}

Upvotes: 2

Related Questions