Skip to content

Commit dd03fcf

Browse files
committed
save forceLoad status to options.forceLoad (for external check, e.g. in infinite.htm demo)
1 parent 0efcc77 commit dd03fcf

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/jquery.lazyloadxt.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,15 @@
1010
dataLazied = 'lazied',
1111
load_error = 'load error',
1212
classLazyHidden = 'lazy-hidden',
13+
docElement = document.documentElement || document.body,
14+
// force load all images in Opera Mini and some mobile browsers without scroll event or getBoundingClientRect()
15+
forceLoad = (window.onscroll === undefined || !!window.operamini || !docElement.getBoundingClientRect),
1316
options = {
1417
autoInit: true, // auto initialize in $.ready
1518
selector: 'img[data-src]', // selector for lazyloading elements
1619
blankImage: 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7',
1720
throttle: 99, // interval (ms) for changes check
18-
forceLoad: false, // force auto load all images
21+
forceLoad: forceLoad, // force auto load all images
1922

2023
loadEvent: 'pageshow', // check AJAX-loaded content in jQueryMobile
2124
updateEvent: 'load orientationchange resize scroll touchmove', // page-modified events
@@ -39,13 +42,10 @@
3942
$window = $(window),
4043
$isFunction = $.isFunction,
4144
$extend = $.extend,
42-
docElement = document.documentElement || document.body,
43-
// force load all images in Opera Mini and some mobile browsers without scroll event or getBoundingClientRect()
44-
forceLoad = (window.onscroll === undefined || !!window.operamini || !docElement.getBoundingClientRect),
45-
elements = [],
4645
$data = $.data || function (el, name) {
4746
return $(el).data(name);
4847
},
48+
elements = [],
4949
topLazy = 0,
5050
/*
5151
waitingMode=0 : no setTimeout
@@ -157,7 +157,7 @@
157157
return;
158158
}
159159

160-
force = force || forceLoad || options.forceLoad;
160+
force = force || options.forceLoad;
161161

162162
topLazy = Infinity;
163163

0 commit comments

Comments
 (0)