Hello,
First of all thank you for this greate module.
There is a problem when you use jc with ajax for large number of content (in my case > 400 items) - the browser is lagging a lot and it stop responding after a while. You need to refresh the page in order for the browser to be responsive again. Tested with chrome and firefox.
I think the problem is that it does not destroy the previous created list items and after a while the list became huge. I think it shoud be done when it add an item it should remove previous ones after adding new one using carousel.remove() I think.
I think here is the problem in jcarousel.js:
// Add items to the jCarousel.
$('ul.jcarousel li', response.display).each(function(i) {
var itemNumber = this.className.replace(/.*?jcarousel-item-(\d+).*?/, '$1');
jcarousel.add(itemNumber, this.innerHTML);
});
but i don't know how to add carousel.remove() to destroy the previous one list elements...
This is critical because it is affecting not only your site but the browser itself.
Comments
Comment #1
quicksketchWhat are the settings in your View? An export would probably be helpful here. Even if you have 400 items in the list total, I'd hope that you wouldn't ever actually have 400 items loaded on the page at one time. You should configure your view to show you only as many items as you need on one arrow click (typically no more than 10 items per page). Or are you saying that users are clicking the next arrow 40 times (loading 10 items per page), which then slows down the browser? In which case I'd consider this edge-case and you should handle it by adding your own bindings to the page to remove items from the list at a certain threshold.
Comment #2
SilviuChingaru commentedI only load 5 items at once....
I think this issue should be critical because acording to Priority levels of issues this bug "render a system unusable (not being able to create content or upgrade between versions, blocks not displaying, and the like), or expose security vulnerabilities. These bugs are to be fixed immediately."
This is my exported view:
Comment #3
quicksketchWhat possible value could you be getting by showing 400 items on the same page? Why not just loop the items at 50? That's still 10 pages of content. This isn't critical because (like I said) it's an edge-case. It is still a bug but not something I'm likely to look into immediately.
Comment #4
SilviuChingaru commentedI wouldn't bother you if I knew java and i hade done it my self but like I said I don't know java. Please be kind and help me to solve this problem because is critical for my site.
I think in jcarousel.js it should be added something like this:
is just one line of code please help me.
Comment #5
quicksketchI don't plan on investigating this issue but I'd be happy to look at patches.
Comment #6
quicksketchThis is probably the same issue as #1227316: Crazy scrolling after a certain amount of items (more than -9999px of scrolling). I've posted a work-around solution you can use there.
Comment #7
thirdshiftguy commentedHow about $('jcarousel_id').html('') or document.getElementById('jcarousel_id').innerHTML = ''. It is the old-school method, but it has the desired effect.