Jihell/unveil — pull request #1 by pgaske (2013-05-17 08:06:43+00:00)
Title: Modified to use a callback mechanism.  Backward compatible usage.

I had a need to use an unveil mechanism on a div, not an img tag.

This commit adds an alternate unveil mechanism. When a div (or whatever) comes into view a callback function is called instead.

Usage is:

$('div').unveil({
threshold: 200, /* optional, default 0 */
unveiled: function () {
console.log($(this));
}
});

Specifying this unveiled callback will disable the existing handling of the img attributes. To use the old behaviour, don't specify the 'unveiled' callback.

Existing handling invoked by:

$(selector).unveil();
$(selector).unveil(200);
$(selector).unveil({ threshold: 200 }); /* equivalent to the previous line */