Giter VIP home page Giter VIP logo

Comments (4)

dkern avatar dkern commented on June 16, 2024

But then it's an issue of your content loader and not of lazy?! The error message says the error is inside of blogloader what is clearly not a lazy function ...

from jquery.lazy.

kinless avatar kinless commented on June 16, 2024

@dkern it's simply the name of the custom loader being used. Whether it's customLoaderName or blogloader is irrelevant since they can be named anything according to your documentation. The full code:

<div class="blogarchive" data-loader="blogloader">
[content]
</div>
$(window).on("load", function() {
		    
	$(".blogarchive").Lazy({
		blogloader: function(element) {
                    element.load();
                }
	});
			
});

Like I said, this works just fine with jQuery 1.x and 2.x, but because of the removal of .load() in jQuery 3.x it breaks. We just need an alternative to element.load() but I'm not sure how that would work with your plug-in (that's the part I'm not really versed in).

from jquery.lazy.

dkern avatar dkern commented on June 16, 2024

As you may saw in the docs, you can also use the response callback on any custom loader.

$(".blogarchive").Lazy({
    blogloader: function(element, response) {
        response(true);
    }
});

from jquery.lazy.

kinless avatar kinless commented on June 16, 2024

@dkern ah ok thank you, that works. I saw the response function but looked like it was only for async situations (which I wasn't using). May want to place a courtesy note in your documentation that the response callback must be used with jQuery 3.x instead of element.load().

Appreciate it!

from jquery.lazy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.