Skip to content Skip to sidebar Skip to footer

Touchmove Data Is Not Transmitted Constantly To Node.js

I have written a little program, in which you can load an image, select the color at the mouse / finger position on clicking, dragging or touchmoving. If I drag the mouse on the im

Solution 1:

Wild guess, but you should probably do less work in getColorAtPos. You traverse the DOM at least five times every time touchmove fires (which is A LOT). Cache your elements, batch your DOM reads and writes etc. Also, you might want to throttle your touchmove handler. I don't know at what rate it fires, but I bet it can overwhelm a mobile device.


Post a Comment for "Touchmove Data Is Not Transmitted Constantly To Node.js"