Giter VIP home page Giter VIP logo

Comments (4)

dkern avatar dkern commented on June 20, 2024

The question is, why there are elements with a source, that should not ne changed in a Lazy instance? Don't add them of they should not be handled. And of you change the elements outside of Lazy, then you need to manually remove them from the instance.

from jquery.lazy.

applibs avatar applibs commented on June 20, 2024

I have another script that puts in another image from another source before Lazy and Lazy doesn't know about it.
Ideally Lazy would create a data-status attribute after inserting the image into src, saying that src has already been changed. At the same time, if I create such an attribute before Lazy, Lazy will skip that element.
And I can do it with callback like this:

afterLoad: function (element) {
    element.attr('data-status', 'done');
}

but Lazy dont know what it means, because callback beforeLoad dont know cancel loading. Am I right?
I tested some flow how to do it, but first call is made by beforeLoad, then my outside script made some changes and then afterLoad. I am unable to control Lazy.

from jquery.lazy.

dkern avatar dkern commented on June 20, 2024

Three ways:

  • Create a custom loader for Lazy.
  • Let the other script remove the item from that Lazy instance to Lazy doesn't handle that item at all.
  • But the best idea would be to create a clean behavior. Two script changing the same attribute on one item is never a good idea. I would suggest changing the workflow.

from jquery.lazy.

applibs avatar applibs commented on June 20, 2024

I see that handledName dooing what I am looking for.

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.