[solved]the pageDT will be fired 'before' the table has been redrawn: How to do 'after'?
[solved]the pageDT will be fired 'before' the table has been redrawn: How to do 'after'?
Hello.
I am attempting to lazy load a column of images using https://github.com/ressio/lazy-load-xt . It works fine for the first page, but doesn't work on subsequent pages. So I'm using the page event to remove the data-src attribute, like so:
$('#result_panden').on( 'page.dt', function () {
var x = document.getElementsByClassName("images");
var i;
for (i = 0; i < x.length; i++) {
x[i].removeAttr('data-src');
}
before doing this:http://stackoverflow.com/questions/24414488/change-data-src-to-src-via-jquery
But this is triggered before the new pagination is displayed. Can you suggest an event that triggers 'after' the new pagination or an alternative method to remove the attribute?
Answers
Got it.
I'm using draw|dt
here is my final code (for lazy loading images beyond the first page)
Essentially it copies the url from data-src to src and then removes data-src