Preload in Post Loop with Vantage Carousel
I’m having problems with the preloading of posts for my Vantage Carousel showing a post loop on my home page. When scrolling right through the posts, the loading of a new page of posts doesn’t start until the last post is almost dropping of to the left. I believe the code is assuming that the widget is only showing one post at the time.
I changed the code in jquery.theme-main.js to say
...
$('.vantage-carousel').each(function() {
var $$ = $(this);
var wrap = $$.closest('.widget');
var pp = $$.find('.carousel-entry').length;
var title = wrap.find('.widget-title');
var position = 0, page = 1, fetching = false, complete = false;
var updatePosition = function() {
if (position < 0)
position = 0;
if (position >= $$.find('.carousel-entry').length - pp) {
if (position != 1) {
position = $$.find('.carousel-entry').length - pp
};
if (!fetching&&!complete) {
fetching = true;
page++;
...which seems to have fixed the issue in my case. I can’t say that it will work all over though…
This is our free support forum. Replies can take several days.
Need fast email support? Get SiteOrigin Premium
Replies
1Hi Fredrik
Thanks for your feedback and effort here.
If you’d like to make this change upgrade safe you’d need to use a child theme, enqueue a a JS file with the same ID so it overwrites the original. And make sure the enqueue function happens after the parent one.
Replies on this thread are closed.
Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.