Option autoInit = false seems to have no effect?
See original GitHub issueIn the sourcecode for lazy-load-xt I see this:
$(document).ready(function () {
triggerEvent('start', $window);
$window
.on(options.loadEvent, initLazyElements)
.on(options.updateEvent, queueCheckLazyElements)
.on(options.forceEvent, forceLoadAll);
$(document).on(options.updateEvent, queueCheckLazyElements);
if (options.autoInit) {
initLazyElements(); // standard initialization
}
});
So, if options.autoinit equals false, then initLazyElements() will not be called on document.ready():
if (options.autoInit) {
initLazyElements(); // standard initialization
}
BUT it will be called on body.load event:
$window
.on(options.loadEvent, initLazyElements)
At this point there is no check if options.autoinit is true or false?
What’s the point of that option if initLazyElement() is still triggered on body.load?
Issue Analytics
- State:
- Created 9 years ago
- Comments:6
Top Results From Across the Web
How do I prevent Conda from activating the base environment ...
Use sub-command conda config to change the setting. conda config --set auto_activate_base false. In fact, the former conda config sub-command is ...
Read more >setting 'site_name' in config doesn't seem to work
Setting site_name in config seems to have no effect what so ever! $config['site_name'] = "Base ExpressionEngine Install";. Is there anything I'm ...
Read more >How to modify the fcs# parameters in an IBM PureData ...
Step 1: Identifying adapters with incorrect settings. ... and the fcs# adapters that appear in the check command, then check with you system ......
Read more >SRDebugger Updates - Stompy Robot
Properties and Methods with [Browsable(false)] attribute will not be displayed in the options tab (applies to SROptions and Option Containers).
Read more >Full list of specifications for _slaaskSettings | Slaask Help Center
By defining a _slaaskSettings object in window, you can interact with our Slaask ... anonymousToken: "abCDefGHijKLmnOPqrSTuvWXyz", noCookie: false, options: ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Just had the same issue. It seems like this line:
should have been blank by default
Seems to work after that.
I can confirm kapajohns solution. In my case I’m using WordPress Sage Theme as a boilerplate and jQuery is in compatibility mode. Therefore my code was:
jQuery.extend(jQuery.lazyLoadXT, { autoInit: false, loadEvent: '' });
As you can see I also had to follow @alonsoysa solution and overwrite the load event for this to work.
This needs to be placed after lazyLoadXT is added to the dom, but before domready is fired. So if you have some sort of domready function, place it just above, for example.