I have a custom Javascript cursor that doesn’t run as smoothly in Safari as Chrome (mac OS). Firefox seems ok but the cursor performs great in Chrome. This is for a portfolio/interactive example so aware hiding cursors is not best practice - but fine is this instance.
Main goals/questions are:
- Can this be optimised to improve performance (smoothness) - mainly noticed in Firefox/Safari
- Occasionally the default cursor (pointer) is displayed even though I’ve set
* { cursor: none !important;}
- is there a better way of doing this? - I hide the cursor on touch devices. Ideally the script could stop running?
CodePen Example: https://codepen.io/moy/pen/popxXXe
You will need to preview on a tall/wide viewport as the issue affects desktop views.
The desired effect is achieved with the above code but in Safari I’m noticing lag/stuttering performance as well as the cursor momentarily stopping when the image of the carousel changes. This is when the cursor is not over the carousel (left half of screen), as the carousel pauses when the cursor is over it.
This seems more noticeable on my build than the CodePen unfortunately but the code does match. The size of the images could maybe be a factor. However this does happen after all the images have been loaded and page refreshed.
Performance in Safari does seem to improve when changing the Timeout value …but then it gets worse in Firefox.
All my browser testing is mac OS (Chrome/Firefox/Safari) so far.
Thanks in advance, hope someone can lend some support