Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image Loading Fails sometimes - DOM elem deleted #6

Open
pratikpoddar opened this issue Feb 10, 2014 · 5 comments
Open

Image Loading Fails sometimes - DOM elem deleted #6

pratikpoddar opened this issue Feb 10, 2014 · 5 comments

Comments

@pratikpoddar
Copy link

Jquery ImageLoader fails one in 100 times for me. When the page loads, it does not give any error and deletes the image dom element. On reloading, it gives me the correct image though. Is there a way the error can be fixed or handled? Thanks

@pratikpoddar
Copy link
Author

I was not able to fix this. Shifted to Lazy Load library. Sorry. Please let me know if you fix this. Thanks

@beatak
Copy link
Owner

beatak commented Feb 15, 2014

Sorry I miss this issue. If there's an example page that I can try, I'll be more than glad to take a look. Thanks.

@aeldar
Copy link

aeldar commented Aug 15, 2014

For me this occures when I try to test low bandwith behavior for my site. In that case it occures very often (but not in all the case). It really removes the DOM element. I used last Chorme and this form of plugin init in code:

('#startpage').imageloader(
    {
        background: true,
        callback: function (elm) {
            $(elm).fadeIn();
        }
    }

@aeldar
Copy link

aeldar commented Aug 15, 2014

It realy removes DOM node when error occures during loading image. The workaround is to specify a parameter eacherror with a function which will handle such errors and make a proper decision to remove or not to remove :) Like that:

('#startpage').imageloader(
    {
        background: true,
        callback: function (elm) {
            $(elm).fadeIn();
        },
        eacherror: function (elm) {
            // don't remove!
        },
        timeout: 30000 // also could be helpfull to increase a timeout for low bandwith
    }

So this is more to a feature than a bug. Though it might not be the expected behavior for the case of using background image.

@beatak beatak reopened this Aug 15, 2014
@beatak
Copy link
Owner

beatak commented Aug 15, 2014

I'll take a look. Thanks for your report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants