CSS - Custom cursor that changes depending on hovered element flickers when moving left to right but not right to left
问题 I am trying to create a custom cursor that changes when hovering over a <div> , but there is a flicker when moving left to right across it, but not when moving right to left. Why this is happening and what I can do to fix it? document.addEventListener('mousemove', (ev) => cursorMove(ev)); function cursorMove(ev) { let circle = document.getElementById('circle'); let posY = ev.clientY; let posX = ev.clientX; circle.style.top = posY + 'px'; circle.style.left = posX + 'px'; } body { margin: 0;