luis-almeida / unveil

A very lightweight jQuery plugin to lazy load images
4.16k stars 676 forks source link

$(this).load(function() #138

Open gitncw opened 7 years ago

gitncw commented 7 years ago

$("img").unveil(200, function() { $(this).load(function() { this.style.opacity = 1; }); });

Firefox does not work!

tzws commented 7 years ago
        $("img").unveil(300, 
        function() {
            $(this).load(function() {
                this.style.opacity = 1;
            });
        });
SuN-80 commented 6 years ago

jQuery event aliases like .load, .unload or .error are deprecated since jQuery 1.8, try to register listeners instead. In short replace $(this).load(function() with $(this).on("load", function(), it should work