jQuery Plugin To Fade Out Element On Scroll - VOpacity

File Size: 3.99 KB
Views Total: 3134
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   
jQuery Plugin To Fade Out Element On Scroll - VOpacity

VOpacity is a lightweight jQuery plugin used to fade out Html elements by adding CSS opacity property (0~1) when they're scrolled out of the viewport.

See also:

Basic usage:

1. Use the Html5 data-content-dynamic-opacity-class attribute to specify which child element you wish to fade out on scroll.

<div class="vopacity"
     data-content-dynamic-opacity-class="vopacity-inner-content">
  <div class="vopacity-inner-content">
    Your content goes here
  </div>
</div>

2. Include jQuery library and the jQuery VOpacity plugin in your document.

<script src="//code.jquery.com/jquery-2.1.1.min.js"></script>
<script src="jquery.vopacity.js"></script>

3. Call the plugin on the parent element and done.

// $fn.vopacity(extraDownSpeed, outerHeight)
$(document).ready(function() {
  $('.vopacity').vopacity(0.15, true);
});

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