0

I am using the jQuery Lazyload plugin from https://github.com/tuupola/jquery_lazyload like this..

jQuery(window).load(function(){

jQuery("img.lazyload").lazyload({
       load : function()
    {
        console.log("dddd"); // Callback here
    }
});
});

But the load function does not appear to be working, I am expecting to get dddd in the console log when a new image is loaded but I get nothing.

Can anyone see what I am doing wrong?

1 Answer 1

0

Your code is fine as far as I can tell (you didn't provide any html so I can't be positive). I did some troubleshooting and discovered the API you are attempting to utilize only works with lazyload versions under version 2. I tested it specifically with lazyload version 1.9.7 - the current 'release' version.

You will have to download the source code, version 1.9.7 from github, and include the jquery.lazyload.min.js file into your project.

Sign up to request clarification or add additional context in comments.

2 Comments

I am loading the image in a modal popup, maybe this is having an effect
Have you tested it with version 1.9.7? With version 2+ your code will not work as the API has been updated and does not include that callback functionality.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.