|File Size:||415 KB|
|Official Website:||Go to website|
A cool jQuery script to dynamically change the opacity level of an element (typically an image) based on the mouse location relative to the element's center.
How to use it:
1. Include the jQuery library and the
jQuery.opacity-by-mouse.js script in your document.
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="jQuery.opacity-by-mouse.js"></script>
2. Insert an image with an unique ID in your document.
<img id="demo-image" src="demo.jpg">
3. Replace the element ID with yours at the end of the jQuery.opacity-by-mouse.js.
},'#your_element_id_here'); // replace it with your element ID