Cuberto / mouse-follower

A powerful javascript library to create amazing and smooth effects for the mouse cursor on your website.
MIT License
724 stars 60 forks source link

Mouse follower cursor appear on Mobile and Tablet Device #28

Open manashjyotix opened 1 year ago

manashjyotix commented 1 year ago

When I use mouse follower it's working fine on desktop but when I double press on mobile and tablet device it shows the mouse cursor dot. It's annoying. I tried everything I can do but didn't work and I also tried the 2 method.

1st one : if (window.matchMedia('(pointer:fine)').matches) { const cursor = new MouseFollower(); }

2nd one : .mf-cursor { @media screen and (max-width: 769px) { display: none; } }

Please help me to fix this issue, thank you

VladLujerdeanu commented 9 months ago

I followed this medium article and it seems to work fine. The solution:

.mf-cursor {
  ...
  @media (hover: hover) {
    display: block;
  }

  @media (hover: none) {
    display: none;
  }
 ...