I use websocket to send the location at the time of mouse move, and when the location is sent, I write the process of reflecting it in the coordinates of the image.
It's not heavy at first, but it gets heavier after using it for a while. (I mean, it jumps off)
Is there anything like that that could be the cause?Please let me know.
Environment, etc.
Send mouse position (I try to call every mouse move event for body tag)
var data={
type: 'mouth_point',
mousePoint: {x:e.clientX, y:e.clientY}
};
ws.send (JSON.stringify(data));
Only reflected when mouse location information is sent
cursorTag.style.left=data.mouthPoint.x+"px";
cursorTag.style.top=data.mouthPoint.y+"px";
Current State Report -- 11/17 Add
Thank you for your reply.When refactoring code after this issue occurs
Before I knew it, the phenomenon stopped happening...The code in the mouse position transmission and reception section is
There seems to have been no problem, so another problem may have affected it.
I am very sorry that the result was like this despite your advice.
Is there a possibility that you have added a mouse move event handler every time an event occurs and sent a lot of requests?
If you output the location information of the mouse every time you receive it, you will be able to check if you send it multiple times in one event.
If you are using Chrome, you can output to the console using console.log ("string").
© 2024 OneMinuteCode. All rights reserved.