Skip to content

Load background images after dom #44

@Deam94

Description

@Deam94

Is there any way to load the "small images" - background images after the dom is load ?
The problem here is i cant use something like lazyload on it and a large number of images end up in slow page load.

Something like:
<a href="images/1.jpg"><img src="images/1_tb.jpg" alt=""></a>
->
<a href="images/1.jpg"><img data-src="images/1_tb.jpg" alt=""></a>

~

var thumb = $('img', this).attr('src')
firstThumb = $('img', this)[0].src

->

var thumb = $('img', this).data('src')
firstThumb = $('img', this).data('src')

...

You can use
$(document).ready(function(){
instead of
$(window).on('load', function() {
then

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions