-
Notifications
You must be signed in to change notification settings - Fork 146
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
Memory leak if one of the images is not loaded #124
Comments
Hi @d-u-a-l! Were you experiencing a problem with this? IE is actually the only browser that would set the image complete property to Try it yourself with this demo. Click the "Load Images" button, then click on any image and it will show the image properties of |
Tried this just now - Opera does not set property to true, if this image is not loaded. I especially set src attr of one of images to non-existent file and value of property complete of this image remained false. |
oh, by the way, I'm using Opera 12.16 |
One more problem - I'm experiencing problems with navigation arrows in IE10. They seems to be not working, but sometimes, when you click at them few times, they begin to work. |
ok, try this code: ic = ('fileSize' in t[i] && t[i].fileSize < 0 && t[i].count > 10) || t[i].count > 10 ? true : t[i].complete; I just tried it in Opera, but since I'm on a Windows platform, I have version 17.0 and it does set the complete property to If that code works, I'll include it with the next update, thanks! Edit: And I'll look into that IE issue. |
Guess it will work. Opera 17 works on Webkit engine, like Chrome and Safari, so it sets complete to true. Opera 12 has it's own engine I've made a website, where navigation is not working, it's on russian language, thou. It may help finding problem on IE |
Well, it looks like the problem is that I haven't had a chance to test it, but I think this additional change is needed: if (c || img.length === 0) {
// all complete, run the callback
if (typeof callback === "function") { callback(); }
} |
it didn't help, because img.length stays the same, as it was after first iteration, because you only push elements to array, but not delete them from it. The thing is, in my case, there's many images, that are hidden, so their height equals 0. That's why code There's another inconvenience - that is a period after page loaded, when you can't use navigation (something like timeout 2*animation speed, o.speed * 2) - but it's not that bad (even thou I use a fairly long animation speed) |
Hmm, you're right... I didn't think about hidden images. Even failed images have a height (alt text), so yeah that height doesn't really do anything, so it should be removed as well. You can always set the o.speed to a low number then elevate it after initialization: $('#slider').on('initialized.movingBoxes', function(event, mb){
mb.options.speed = 2000; // or whatever
}); Thanks! |
It's in base.imagesLoaded function
must be like
because in your case ic would never be true, even after 10 iterations it would be t[i].complete, which is false, because img is not loaded
The text was updated successfully, but these errors were encountered: