reveal-it.js: Gradually reveals text from left to right producing an animated text fade-in effect

Gradually reveals text from left to right producing an animated text fade-in effect.
Limitation: Only works on a solid color background.

Download: https://github.com/erspark2002/reveal-it.js

Demonstration:

Plugin homepage:

Implementation:

        <div class="container">
            <div class="row">
                <div class="col-xs-12">
                    <h1 class="text-center">reveal-it.js Examples</h1>
                    <h2 class="sr-only">This jQuery plugin gradually reveals text from left to right to produce a fade-in effect.</h2>
                    <p>
                        <a href="index.html">Click here for the demo.</a>
                        Get it on <a href="https://github.com/erspark2002/reveal-it.js">github here</a>.
                    </p>
                    <p>
                        Limitations: The background color must be solid.
                    </p>
                </div>
            </div>
        </div>
 
 
        <div class="container">
            <div class="row">
                <div class="col-xs-12">
                    <p>
                        Box 1: reveal immediately - on page load
                    </p>
                    <pre class="brush: html">
<div class="container">
    <div class="row">
        <div class="col-xs-12">
            <p>Box 1: Reveal Immediately</p>
            <div class="box1">
                <h1>Lorem ipsum dolor sit amet, ne mel vero impetus voluptatibus</h1>
            </div>
        </div>
    </div>
</div>
                    &nbsp;</pre>
 
<pre class="brush: js;">
jQuery(function () {
    //Box 1: reveal immediately - on page load
    //NOTE: id does refer to an element id, It is used to
    //      uniquely refer to the element to be revealed.
    var options1 = {
        id: 'box1'
    };
    $('.box1').initReveal(options1);
});
                    &nbsp;</pre>
                </div>
            </div>
        </div>
 
        <div class="container">
            <div class="row">
                <div class="col-xs-12">
                    <p>
                        Box 2: reveal after specified delay
                    </p>
                    <p>
                        Set a background color.
                    </p>
 
                    <pre class="brush: html;">
<div class="container" style="background-color: #555;">
    <div class="row">
        <div class="col-xs-12">
            <p>Box 2: Reveals after 3000ms delay</p>
            <div class="box2">
                <h1>Lorem ipsum dolor sit amet, ne mel vero impetus voluptatibus</h1>
            </div>
        </div>
    </div>
</div>
                    &nbsp;</pre>
 
 
                    <pre class="brush: js;">
var options2 = {
    id: 'box2'
    , delay: 3000
    , background: '#555'
};
$('.box2').initReveal(options2);
              &nbsp;</pre>
                </div>
            </div>
        </div>
 
        <div class="container">
            <div class="row">
                <div class="col-xs-12">
                    <p>
                        Box 3: reveal on event - eg. onclick
                    </p>
 
                    <pre class="brush: html;">
<div class="container">
    <div class="row">
        <div class="col-xs-12">
            <p>Box 3: Reveal on click event</p>
            <div>
                <div class="box3">
                    <h1>Lorem ipsum dolor sit amet, ne mel vero impetus voluptatibus</h1>
                </div>
            </div>
 
            <button class="btn btn-primary btn-reveal">Reveal!</button>
        </div>
    </div>
</div>
              &nbsp;</pre>
 
                    <pre class="brush: js;">
var options3 = {
    id: 'box3'
    , auto: false
};
var box3 = $('.box3');
box3.initReveal(options3);
 
$('.btn-reveal').on('click', function () {
    box3.performReveal(options3);
});
              &nbsp;</pre>
                </div>
            </div>
        </div>
 
        <div class="container">
            <div class="row">
                <div class="col-xs-12">
                    <p>
                        Box 4: Reveal when element scrolls into the viewport
                    </p>
 
                    <pre class="brush: html;">
<div class="container">
    <div class="row">
        <div class="col-xs-12">
            <p>Box 4: Reveal when element scrolls into the viewport</p>
            <div>
                <div class="box4">
                    <h1>Lorem ipsum dolor sit amet, ne mel vero impetus voluptatibus</h1>
                </div>
            </div>
        </div>
    </div>
</div>
              &nbsp;</pre>
 
                    <pre class="brush: js;">
var options4 = {
    id: 'box4'
    , auto: false
    , trigger: 'on-visible'
};
$('.box4').initReveal(options4);
              &nbsp;</pre>
                </div>
            </div>
        </div>

Options:

backgroundStringDefault : #fff – set background color.
delayIntegerDefault : 3000 – delay the fade-in effect by specified milliseconds
triggerStringDefault : on-visible – Reveal the text when the element scrolls into the viewport

Methods:

initReveal(options)Functioninitialise the plugin. eg. $(‘.box’).initReveal(options);

Creating a JavaScript Library

I recently wrote a JavaScript library for creating random colors and color schemes, and while I foun…

jQuery Flash Plugin

This jQuery plugin is for embedding Flash movies. Pages are progressively enhanced when Flash and Ja…

jQuery Optimization: Optimize Selector

We can also optimize our selector other than being a bit specific on our selector. The key to optimi…

jQuery drop down menu: droppy

Quick and dirty nested drop-down menu in the jQuery style. I needed a nav like this for a recent pro…

jQuery slideViewerPro: A “pro” jQuery image slider

slideViewerPro is a fully customizable jQuery image gallery engine which allows to create outstandin…

jQuery Optimization: Avoid Unnecessary Styling

This is another common mistake that many jQuery developer made. jQuery provides us with the ability …