jquery-lazyload images in jquery-databables

前端 未结 1 1885
遇见更好的自我
遇见更好的自我 2020-12-21 12:51

With the datatables javascript plugin I want to display 10k little images in a table with pagination.
Because I load too much of them, I get errors.

I would li

相关标签:
1条回答
  • 2020-12-21 13:20

    I found another method here without the lazyload plugin.
    Use the option

    "fnRowCallback": customFnRowCallback
    

    and then this function will replace the first column with an image tag.

    function customFnRowCallback( nRow, aData, iDisplayIndex )
    {
        $('td:eq(0)', nRow).html( '<img class="" src="http://aaaaa/'+ aData.attribute+'" alt="" />' );
        return nRow;
    }
    
    0 讨论(0)
提交回复
热议问题