Code: Select all
function unveil() {
var inview = images.filter(function() {
var $e = $(this);
if ($e.is(":hidden")) return;
var wt = $w.scrollTop(),
$w = $(window),
wb = wt + $w.height(),
et = $e.offset().top,
eb = et + $e.height();
return eb >= wt - th && et <= wb + th; // what is this math all about really ??
});
loaded = inview.trigger("unveil"); // What is happening on these 2 lines ??
images = images.not(loaded);
}
$w.on("scroll.unveil resize.unveil lookup.unveil", unveil); // i understand the onfunction , but what is "scroll.unveil resize.unveil lookup.unveil" ??