- Overview
- Documents
FadeThis is a lightweight jQuery plugin for fade-as-you-scroll features.
Source: zolweb.github.io
1. INCLUDE JS FILES
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script> <script src="dist/jquery.fadethis.min.js"></script>
2. HTML
<div class="block"> <div class="slide-left"></div> </div>
Appear from left
<div class="slide-left"></div>
Appear from right
<div class="slide-right"></div>
Appear from top
<div class="slide-top"></div>
Appear from bottom
<div class="slide-bottom"></div>
3. JAVASCRIPT
$('.block').fadeThis({speed: 1000});
4. OPTIONS
speed: Animation speed in milliseconds.
default: 500
distance: Element distance to its emplacement, before animation.
default: 50
offset: Scroll offset, allowing to fire fading a little after or before the element appear.
default: 0
easing: Animation easing.
default: "swing"
If you're using custom easing, you may need to also use jQuery Easing.
reverse: Make element disappear again when scrolled out, and fade again when scrolled in.
default: true
Set this to false if you want elements to stay on page after they appear once.
baseName: Base class name for target elements.
default: "slide-"
scrolledIn: Function to call when the element come in viewport.
default: null
This function is always called, even if reverse is set to false.
scrolledOut: Function to call when the element go out of the viewport.
default: null
This function is always called, even if reverse is set to false.