Hey this looks great, I tried adjusting for a horizontal container rather than the default vertical scrolling - and it works to show just the visible images, but doesn't do anything on scroll. Probably because I replaced "scrollTop" with "scrollLeft" which I sort of made up!
Here is what I adjusted:
function unveil() {
var inview = images.filter(function() {
var $e = $(this);
if ($e.is(":hidden")) return;
var wt = $w.scrollLeft(),
wb = wt + $w.width(),
et = $e.offset().left,
eb = et + $e.width();
return eb >= wt - th && et <= wb + th;
});
Hey this looks great, I tried adjusting for a horizontal container rather than the default vertical scrolling - and it works to show just the visible images, but doesn't do anything on scroll. Probably because I replaced "scrollTop" with "scrollLeft" which I sort of made up!
Here is what I adjusted: