Prevent drag and drop windows in ios5 mobile browser

I am working on games for the iPad browser and cannot block the window. I prevented scrolling using typical overflow methods, but the whole window still stretches up and down (a new effect like rubber band)

Is there any way to remove this drag and drop window?

Thannks

+4
source share
1 answer

Snap to touchmove and prohibit the action that scrolls

 document.body.addEventListener('touchmove', function (ev) { ev.preventDefault(); }); 

Or using jQuery

 $('body').bind('touchmove', function (ev) { ev.preventDefault(); }); 

EDIT: I really came across another solution that could be even simpler try this

 body { overflow: hidden; } 
+7
source

Source: https://habr.com/ru/post/1389953/


All Articles