jQuery Plugin To Fade In Elements Based On Mouse Position - Relative Fade

File Size: 9.66 KB
Views Total: 986
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   
jQuery Plugin To Fade In Elements Based On Mouse Position - Relative Fade

Relative Fade is a jQuery plugin used to track the mouse position and adds a fade-in effect to nearby element that auto updates on mouse move. The goal is to progressively change the opacity of a specific element based on the distance from your mouse position.

How to use it:

1. Insert jQuery library and the jQuery relative fade plugin into your webpage.

<script src="//code.jquery.com/jquery.min.js"></script>
<script src="jquery.relative-fade.js"></script>

2. Just call the function on the target element and the plugin will do the rest.

$('.element').relativeFade();

3. Config the fade in effect.

$('.element').relativeFade({

  // initial opacity level
  initialOpacity: .2,

  // sensitivity
  sensitivity: 50
  
});

This awesome jQuery plugin is developed by jrutheiser. For more Advanced Usages, please check the demo page or visit the official website.