Skip to content

Msdhu/lazyLoader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

lazyLoader

jQuery.Deferred()实现的 image lazyLoader

使用如下:

// $.Deferred 实现的 img lazyLoad

$imageContainer.find('img').each(function() {
    var $ele = $(this);
    var url = $ele.attr('data-src');
    if (url) {
        $.lazyLoader(url, true, function(image) {
            $ele.attr('src', image.src);
            $ele.addClass('img-show');
        });
        $ele.removeAttr('data-src');
    }
});

About

jQuery.Deferred()实现的 image lazyLoader

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published