我正在寻找一种效果,当我将鼠标靠近 到一个元素时,该元素的不透明度从 0(不可见)变为 100。
我不是在寻找典型的鼠标悬停/鼠标悬停组合。
不透明度应该取决于鼠标与元素的距离。不透明度将在元素周围的 100px 边界内增加,直到鼠标到达该元素。那么它将是 100 不透明度。
有没有类似的插件?
最佳答案
是的,Approach是一个完全按照您的描述执行的插件,
Approach is a jQuery plugin that allows you to animate style properties based on the cursor’s proximity to an object. It works in a very similar manner to
jQuery animate
, however it animates over distance instead of time.
关于 main page 的第二个演示特别是与您相关的声音。
关于随着鼠标靠近元素,Jquery 淡入,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1652703/