Forum Moderators: Robert Charlton & goodroi
I'm not sure what you mean by miniatures, if you're referring to the gallery. The entire top 10 for the target keywords, are dominated by galleries. It wouldn't make sense for it not to.
(function($) {
$.fn.appear = function(fn, options) {
var settings = $.extend({
//arbitrary data to pass to fn
data: undefined,
//call fn only on the first appear?
one: true,
//call fn when element is within this many pixels of viewport
threshold: 0
}, options);
return this.each(function() {
var t = $(this);
t.appeared = false;
var check = function() {
if (!xw.s) xw.s = xw.scrollTop();
if (!xw.h) xw.h = xw.height();
if (!t.y) {t.y = t.offset().top;}
if (t.y <= xw.s + xw.h + settings.threshold) {
t.trigger('appear', settings.data);
}
};
var modifiedFn = function() {
t.appeared = true;
if(t.wbinded) xw.off('scroll', check).off('resize', check);
fn.apply(this, arguments);
};
t.one('appear', settings.data, modifiedFn);
(check)();
if (!t.appeared) { xw.on('scroll', check).on('resize', check); t.wbinded = true; }
});
};
})(jQuery);
//LAZYload
var xw=$(window);
xw.on("scroll", function(){if (xw.s) delete xw.s;});
xw.on("resize", function(){if (xw.h) delete xw.h;});
$("#YOUR-CONTENT-DIV-ID").find("img[data-src]").appear(function(){
$(this).attr('src', $(this).attr('data-src'));
},{threshold:200});
[edited by: tedster at 4:59 pm (utc) on Jan 30, 2012]
[edit reason] turn off automatic linking [/edit]