Question about Sketching site on iPad, drag and drop

I tested the new html5 and js functions to create a site for thumbnails. I considered this for a potential client who wants their site to be accessible on ipad, but also has drawing features on it.

So, I created a rough experiment in which you can drag the mouse around the screen to draw lines. I went to check it on the ipad and realized that this did not work. What for? because drag and drop on the ipad is reserved for actually moving the screen around.

Is there anything that can be done to get around this? I am sure that this can be done if you make an application, but what about a regular website.

+4
source share
2 answers

In your code, replace your events as follows:

  • onmousedown => ontouchstart
  • onmousemove => ontouchmove
  • onmouseup => ontouchend

At least that's how it works on the iPhone. Further reading: http://www.sitepen.com/blog/2008/07/10/touching-and-gesturing-on-the-iphone/

+5
source

Shameless self-esteem - I developed a jQuery plugin for drawing on a website via HTML5 to collect signatures on the iPad screen. http://www.crowdsavings.com/open-source/drawbox

+1
source

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


All Articles