Giter Site home page Giter Site logo

Comments (3)

imsky avatar imsky commented on September 26, 2024

The reason an error is thrown on invisible elements is exactly because there is an inconsistency across browsers when getting the client dimensions for an element. The logic to get reasonable dimensions quickly becomes complicated (if the parent element is also invisible, for example). I'll look into this again, though it may require a more explicit workaround than just falling back to the parent element.

from holder.

siamcomm avatar siamcomm commented on September 26, 2024

I am also having a similar issue. It seems to happen on the BootStrap 3.0+ carousel, but only for slides that are not yet visible (set with the class of "active").

In Chrome, the size (hxw) seems to be maintained, but in FF, the size for the slides not yet visible is not honored at all.

Any suggestions or progress on a potential fix?

from holder.

imsky avatar imsky commented on September 26, 2024

This likely won't have a permanent fix, due to the previously mentioned problems. The logic just gets too complicated when considering all possible cases. However, since an error callback has been introduced, there is a workaround that will continuously attempt to render all invisible placeholders. You'll have to override the error callback in the following way:

Holder.invisible_error_fn = function(fn){
    return function(el){
        setTimeout(function(){
            fn.call(this, el)
        }, 10)
    }
}

This workaround does not provide optimal performance, so it should only be used in special cases. You can also use the callback to create a solution that works in your case.

from holder.

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.