Reputation: 10584
I would like to disable lazy image loading, so I want to run the following js code before FrameLoadEnd event is triggered.
$('#images img').each(function() {
$(this).attr("src", $(this).attr("original"));
});
Is it possible?
Upvotes: 0
Views: 203
Reputation: 4410
You can execute JavaScript in FrameLoadStart, the event is fired very early in the page load lifecycle, before the DOM has loaded.
You execute JavaScript in FrameLoadStart to hook the DOMContentLoaded event, in practice this is often very similar in timing to FrameLoadEnd event.
window.addEventListener('DOMContentLoaded', (event) => {
//Do something on DOM load.
});
Upvotes: 1