Skip to content

Commit 944df4b

Browse files
committed
fix calls to each() method
1 parent fbdfe48 commit 944df4b

4 files changed

+4
-4
lines changed

src/jquery.lazyloadxt.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
elementOptionsOverrides[prop] = getOrDef(overrides, prop);
107107
}
108108

109-
return this.each(function (el) {
109+
return this.each(function (index, el) {
110110
if (el === window) {
111111
$(options.selector).lazyLoadXT(overrides);
112112
} else {

src/jquery.lazyloadxt.picture.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
if (matchMedia) {
1919
$el
2020
.children('br')
21-
.each(function (el) {
21+
.each(function (index, el) {
2222
var $child = $(el),
2323
source = isFuncSrcAttr ? srcAttr($child) : $child.attr(srcAttr),
2424
media = $child.attr('media');

src/jquery.lazyloadxt.script.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
srcAttr = 'data-src';
2727
}
2828

29-
$('br[' + dataLazyTag + '],span[' + dataLazyTag + ']').each(function (origElem) {
29+
$('br[' + dataLazyTag + '],span[' + dataLazyTag + ']').each(function (index, origElem) {
3030
var attrs = origElem.attributes,
3131
el = document.createElement($(origElem).attr(dataLazyTag)),
3232
i;

src/jquery.lazyloadxt.video.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
$el
1717
.attr('poster', $el.attr(options.videoPoster))
1818
.children('source,track')
19-
.each(function (el) {
19+
.each(function (index, el) {
2020
var $child = $(el);
2121
$child.attr('src', isFuncSrcAttr ? srcAttr($child) : $child.attr(srcAttr));
2222
});

0 commit comments

Comments
 (0)