Disable Zooming
Posted: Sat Dec 10, 2016 2:18 pm
I'd like to create a full screen app for an android tablet but don't want to allow zooming/panning the content, is it possible to disable that?
Code: Select all
;// No Zoom
! var meta = document.createElement('meta');
! meta.name = "viewport";
! meta.content = "width=device-width, user-scalable=no";
! document.getElementsByTagName('head')[0].appendChild(meta);
Great, thank you.Fred wrote:I will add this in for all mobile app, as it makes no sens to zoom/pan an app
And now this is a big pain in applications that need scaling.Fred wrote: Sun Dec 11, 2016 7:36 am I will add this in for all mobile app, as it makes no sens to zoom/pan an app
Code: Select all
OpenWindow(0, 100, 100, 320, 200, "Window", #PB_Window_Background )
ButtonGadget(0, 10, 200, 200, 60, "Multiline Button Multiline Button Multiline Button Multiline Button", #PB_Button_MultiLine)
! document.querySelector("meta[name=viewport]").setAttribute('content', 'width=device-width, initial-scale=1.0, user-scalable=1');
! $('html, head, body, .spiderwindow, .spiderwindow div:first-child, .spiderwindow-background, .spiderwindow-background div:first-child').css("touch-action", "auto");