1

Possible Duplicate:
Disable vertical bounce effect in an ipad web app

Is there a way to disable the bounce effect in a scrolling div?

So far I have tried these things but none have worked. Please help!

And

Thanks!

Community
  • 1
  • 1
imhere
  • 4,405
  • 7
  • 26
  • 25
  • You asked the same question few days ago: http://stackoverflow.com/questions/10761746/disable-vertical-bounce-effect-in-an-ipad-web-app/10801645 This is an exact duplicate. – woz May 29 '12 at 19:37

2 Answers2

3
for (id subview in webView.subviews)
  if ([[subview class] isSubclassOfClass: [UIScrollView class]])
  ((UIScrollView *)subview).bounces = NO;

Add this in your app delegate. Where the webview is your app webview.

STOP UIWebView bounces vertically in device

Or try this. Go to Cordova.plist file may be PhoneGap.plist in the supporting files group. Set the topmost key value pair appropriately. Set it it NO for the key UIWebViewBounce.

Community
  • 1
  • 1
MadNik
  • 7,713
  • 2
  • 37
  • 39
1

I can suggest you thing with doing some calculations of your div. add:

 document.addEventListener("touchStart",<method>,true/false), 

 document.addEventListener("touchMove",<method>,true/false) 

 document.addEventListener("touchEnd",<method>,true/false).

When you start scrolling respective methods will start calling. In touchMove specified method calculate the height of the div which you are doing scrolling.

If scrolling came to the end (means div height max reached) allow user to scroll once finger removed touchEnd respective method will call. There see the current e.changedTouches.pageY it will give you the current place of the div on the scree. simply set the height of the div to the actual height of the div. I hope it will help you

Brett Gregson
  • 5,867
  • 3
  • 42
  • 60
Bharath
  • 161
  • 1
  • 3
  • 13