自定义光标不跟随滚动

问题描述 投票:0回答:0

我正在做一个网站,其中有一个自定义光标,一个绿色圆圈,但是当滚动超过页面高度的 100% 时它不会跟随鼠标。

游标的css如下

*{
   cursor: none;
 }
 
 .cursor {
   position: absolute;
   width: 40px;
   height: 40px;
   background: $green;
   border-radius: 50%;
   top: var(--y, 0);
   left: var(--x, 0);
   transform: translate(-50%, -100%);
   z-index: 2;
   mix-blend-mode: difference;
   pointer-events: none;
 }

你可以在下面的链接上看到它是如何工作的,然后转到工作页面,它有足够的内容可以滚动查看问题

https://marclopez.oddsolutionslab.com

css reactjs pointers styles cursor
© www.soinside.com 2019 - 2024. All rights reserved.