0

I'm trying to make a div go fullscreen when I click a button, and when I do that I want the body element to NOT scroll. It works nicely on the browser or iPad simulator (Xcode) but in the actual iPad I can still scroll down/up

basically, this is the button changing the style when it's clicked:

            document.getElementsByTagName('body')[0].style.overflow = 'hidden'
            document.getElementsByTagName('body')[0].style.position = 'fixed'
            document.getElementsByTagName('body')[0].style.height = '100%'
            document.getElementsByTagName('html')[0].style.overflow = 'hidden'
            document.getElementsByTagName('html')[0].style.position = 'fixed'
            document.getElementsByTagName('html')[0].style.height = '100%'
Gustavo
  • 874
  • 4
  • 13
  • 27
  • i suggest use jquery – Diego Avila May 07 '18 at 20:31
  • @Tegito123 I'm using angularjs and can't use jquery for some specifics reasons regarding my project – Gustavo May 07 '18 at 20:33
  • Possible duplicate of [Does overflow:hidden applied to work on iPhone Safari?](https://stackoverflow.com/questions/3047337/does-overflowhidden-applied-to-body-work-on-iphone-safari) – Will May 07 '18 at 21:09

0 Answers0