Hi Maak,
almDone only fires when there are no remaining posts.
I think you want the almComplete callback. This fires after every Ajax load.
Does this make sense?
A complete list can be found here.
https://connekthq.com/plugins/ajax-load-more/docs/callback-functions/
Hey Dooney,
Wow – thanks for the ultrafast reply!
I see. On the WordPress site it just says this … ALM Done – The almDone() function is triggered after all posts have been loaded..
That’s why the misunderstanding … anyway, I had tried almComplete initially however that fires too early, before the posts have been loaded and while the height of the container still has the initial value. At least as far as I can tell …
Reason for all this is I have some events taking place on scrolling and I need to update them with the new height after the posts have loaded.
Oh well, it works for now … but maybe it’s an idea to have a callback after the content has been loaded …. or perhaps just add the delay into almComplete? Just saying 😉
Cheers
Maak
Ya, almDone triggers after ALL posts have been loaded. Maybe I should say when no posts remain.
almComplete shouldn’t fire until elements have been added to the DOM so that’s strange.
Can you post your shortcode and I’ll run some tests to see how this is working.
Maybe a work around would be to delay the functions you are triggering in the almComplete? SetTimeout?
Yeah, I did at first use a timeout. But it’s hard to know how long the load takes and probably depends on a number of factors I can’t predict so hacking your js seemed the better fix for now.
Here’s the shortcode
‘[ajax_load_more post_type=”bites” offset=”4″ pause=”true” posts_per_page=”4″ scroll=”false” images_loaded=”true” button_label=”MORE BITES”]’
Thanks again….
On second thoughts, since it seems the main difference between almDone and almComplete is the timeout you set using the speed variable, I wonder if this is a viable solution?
$.fn.almComplete = function(alm){
setTimeout(function() {
updateScroll(); // my events updated in here
}, alm.speed + 10);
};
Or does this still leave me open to potential differences in loading speed of the content … ?
Are you using the latest version?
I had fixed an issue with images_loaded and almComplete in 2.10.0 .. maybe it’s still present. The issue was almComplete was firing before the images were loaded.