Skip to content

Commit

Permalink
fixed typo
Browse files Browse the repository at this point in the history
  • Loading branch information
jney committed Nov 3, 2010
1 parent 26d1193 commit cdeffc4
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions jquery.lazyload.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,20 @@
, event: SCROLL
, effect: "show"
, container: window
, namespace: '.lazyload'
};

if(options) $.extend(settings, options);

var container = $(settings.container);

/* Convenience methods in jQuery namespace. */
/* Use as belowthefold(element, {threshold : 100, container : window}) */

var isInViewport = function (element) {
if (!element.length) return false;

var container = $(settings.container)
, threshold = settings.threshold;
var threshold = settings.threshold;

if (container[0] === window) {
var bottom = container.height() + container.scrollTop()
Expand Down Expand Up @@ -70,7 +72,7 @@

/* Fire one scroll event per scroll. Not one scroll event per image. */
if (settings.event === SCROLL) {
$(settings.container).bind(SCROLL, function () {
container.bind(SCROLL, function () {
var counter = 0;
elements.each(function() {
if (isInViewport($(this))) {
Expand All @@ -81,7 +83,7 @@
});
/* Remove image from array so it is not looped next time. */
elements = $($.grep(elements, function(e) {
if (e.loaded) e.removeData(ORGINAL);
if (e.loaded) $(e).removeData(ORIGINAL);
return !e.loaded;
}));
});
Expand Down Expand Up @@ -135,7 +137,7 @@
});

/* Force initial check if images should appear. */
$(settings.container).trigger(settings.event);
container.trigger(settings.event);

return this;
};
Expand Down

0 comments on commit cdeffc4

Please sign in to comment.