Answer the question
In order to leave comments, you need to log in
Bitrix & Lazy Load Images and Asynchronous Content Loading?
Through OnEndBufferContent , I
return src back to all tags in JS after loading. Everything works fine, loading by scroll and resize is not needed. But 2 problems appeared
1. The site has loadable Ajax content, these are product blocks and the cart itself and others, respectively, there the data-src does not change through JS, what about asynchronous content loading in this case? Maybe Bitrix has an event after Ajax execution? tried this<img src заменил на <img data-src
BX.addCustomEvent('onAjaxSuccess', function () { console.log("test onAjaxSuccess"); })
doesn't work... <div style="background-image:url(...) ..." ---> <div data-background-image="src.url" ?
Answer the question
In order to leave comments, you need to log in
1) OnEndBufferContent fires on ajax requests. At least in the standard Bitrix templates, as well as the onAjaxSuccess event (you can put any demo solution out of the box and test it). In this case, the first argument to onAjaxSuccess is the result of the request. If all this does not happen, then BX.ajax is not used.
2) And this depends entirely on the plugin you are using for lazy loading.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question