fr.javascript.info icon indicating copy to clipboard operation
fr.javascript.info copied to clipboard

interrupting the ball displacement when the cursor go off zone

Open Darkosphere opened this issue 3 years ago • 0 comments

This will fix the bug that keeps the ball to follow the cursor when going off the container zone. At this moment you need to reload the page to get rid of this bug.

Just add this :

document.addEventListener('mouseout', function() {
        ball.dispatchEvent(new Event('mouseup'));
});

You may need to adapt document to the container that you use in your example.

Darkosphere avatar May 13 '22 17:05 Darkosphere