Load Img only upon Display

Load Img only upon Display

Neil_SNeil_S Posts: 1Questions: 0Answers: 0
edited February 2013 in DataTables 1.9
Hi Allan,

Firstly - thanks for the great script.

I've been looking over the documentation and cannot see an example of how to load images only when the rows are displayed.

The scenario is a 400 row table with an image in one of the columns. e.g. A real estate or book sale site.

e.g.

Description>Image

Description 1
.................
.................
Description 400



The text is fairly light weight, so can be downloaded quickly and is ideal to be manipulated in datatables. However the images are large and only need to be displayed if the user views that particular page/row. Unfortunately, the default html functionality would cause all the images to be unnecessarily downloaded.

A couple of forum posts allude to being able to use javascript, presumably with an on display type event to allow the text to be downloaded, but the images to only be downloaded as required. I could experiment for hours to come up with a solution, but would prefer not to reinvent the wheel.

Do you have a working example of delayed image loading that you could share?

Thanks,

Neil
This discussion has been closed.