Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Disable scrolling webview

Is it possible to disable scrolling in a webview without setting touchEnabled on false? Or maybe turn off the bounce effect? My webpage is smaller than the screen and i don't want the user to know that he is looking to a webview.

Thanks

— asked October 12th 2010 by Peter Griffin
  • scrolling
  • webview
0 Comments

4 Answers

  • You need to set the event listener inside your html file:

    document.ontouchmove = function(event){ event.preventDefault(); }

    — answered September 9th 2011 by Dominik Koscielak
    permalink
    4 Comments
    • this doesn't work for me.

      — commented December 9th 2011 by Sting Tao
    • Is your html file local? This only works with local html files.

      — commented December 9th 2011 by Dominik Koscielak
    • If you need to serve remote website in a webview, serve it in an iframe of a local html file.
      Then add

      document.ontouchmove = function(event){ event.preventDefault(); }
      

      in your local html and you should be good.

      — commented December 9th 2011 by Dominik Koscielak
    • Thanks Dominik, this works well for me.

      — commented January 20th 2012 by Shamsul Azhar Ahmad Shamsuddin
  • Does anybody know how to disable this???

    — answered December 17th 2010 by Aee Q
    permalink
    0 Comments
  • Have you tried to play with the overflow in your webview's css?

    Like:

    html, body{
    overflow: hidden;
    }
    

    Maybe?

    — answered December 17th 2010 by Arthur Roussel
    permalink
    0 Comments
  • can you do scrollable:false when you create the webView ? You can for normal views…

    — answered October 12th 2010 by Critter
    permalink
    3 Comments
    • That doesn't work :(

      — commented October 13th 2010 by Peter Griffin
    • Hey Peter, did you ever figure out how to get around this issue?

      — commented July 21st 2011 by Chien-Hung Chen
    • Just realize your name is Peter Griffin. lol

      — commented July 21st 2011 by Chien-Hung Chen
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.