Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Event touchstart WORKS but touchend not. You can use onmouseup="SOMEfun()" Even the Samsung Galaxy 3 is a problem with the trigger event. Add the first event and thay will be working on but Two scenario : 1)first add onmouseup and than tauchstart or better 2)check mobile or desktop and than add proper events You can use my detectbrowser function , its very nice (give a name of browser type like mobile_chrome_android_tablet or firefox_desktop , safari_ipad)</p> <p>Make NOMOBILE global , you can simply replace var NOMOBILE =0; with window["NOMOBILE"]=0;</p> <p>download browser and device detector : <a href="https://maximumroulette.com/visual-js/lib/init.js" rel="nofollow noreferrer">detect browser and device also class</a></p> <p>Class name is DETECTBROWSER() </p> <p>(on first line in script)</p> <p>var BROWSER = new DETECTBROWSER()</p> <p>Check this BROWSER.NAME </p> <p>This is even crazy't script . Track 10 fingers at same time (in canvas2d) link : <a href="https://github.com/zlatnaspirala/multi-touch-canvas-handler" rel="nofollow noreferrer">https://github.com/zlatnaspirala/multi-touch-canvas-handler</a></p> <p><strong>example for 1)</strong></p> <pre><code> document.getElementById('myCanvas').addEventListener('touchstart', function(event) { event.preventDefault(); var touch = event.touches[0]; /* Avatar go left */ if (touch.pageX &lt; 235) { if (backgroundX &lt; 0){ left = 1; } /* Avatar go right */ if (touch.pageX &gt; 470) { right=1; } /* Avatar go lower distance */ if (touch.pageX &gt; 235 &amp;&amp; touch.pageX &lt; 470 &amp;&amp; touch.pageY &gt;250 ) { distance--; } /* Avatar go to high distance */ if (touch.pageX &gt; 235 &amp;&amp; touch.pageX &lt; 470 &amp;&amp; touch.pageY &lt;250 ) { distance++; } } ,false); // solution for touchend function ENDoff(){ if (moveLEFT==1) { moveLEFT=0; } if (moveRIGHT==1) { moveRIGHT=0; } } HTML CODE &lt;canvas id="myCanvas" width="480" height="960" onmouseup="touch_UP();"&gt;&lt;/canvas&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload