In Javascript, is it possible in a mousemove event handler to determine if there are any pending mousemove events in the queue?
Or, preferably, is it possible to make the event queue skip all mousemove events in the queue except for the most recent one?
I'm using mousemove & other mouse events to allow users to drag elements around the screen, and I don't need to waste CPU & GPU cycles redrawing the dragged items on every mousemove event (in which I update the top & left CSS properties), as long as I can skip intermediate events quickly enough.
My site is not currently experiencing any performance or visualization problems; I just want to make my JavaScript as efficient as possible.