qlex266 on "[Plugin: Ajax Pagination and Infinite Scroll] Callback"

ساخت وبلاگ

mpseitenweise
Member
Posted 2 weeks ago #

Is there any way to run a javascript function after new posts have been loaded?
I need to run a match height js.

https://wordpress.org/plugins/malinky-ajax-pagination/

malinkymedia
Member
Plugin Author

Posted 2 weeks ago #

Hi, currently not but I'm happy to a look for you as I think would be useful for other users.

Most likely this will be next week when I get an opportunity to look but will keep you updated.

Thanks

mpseitenweise
Member
Posted 2 weeks ago #

Appreciate your quick reply and look forward to it!

Hi, i need that function me too because after the infinite scroll is loaded facebook , google , twitter and bookmark post don't work anymore for me .. so it's really important .
Please try to add this function callback.

mpseitenweise
Member
Posted 1 week ago #

If it helps anyone, I've solved this with the help of a jQuery library:
https://github.com/marcj/css-element-queries

You need to embed ResizeSensor.js and ElementQueries.js and then you use this snippet.

jQuery(window).load(function() { new ResizeSensor(jQuery('.content'), function(){ // do whatever you want here });
});

The .content has to be the container that holds all posts.
The ResizeSensor library checks if .content gets resized (which it does, because you are loading new posts inside of it). And when it does, it calls a js function.

malinkymedia
Member
Plugin Author

Posted 1 hour ago #

Sorry for the delay on this but there is a now a callback in the plugin.

In the settings there will be a box at the bottom where you can add any javascript code to be executed after the new posts have been loaded.

If you need them the callback is passed two parameters an array of the posts that were added called loadedPosts and the current url called url.

If you are using the callback to load isotope/masonry then I have added an example to the plugin website. http://wordpress-ajax-pagination.com/category/isotope.

Let me know if you need any assistance.

Thanks

qlex266
Member
Posted 7 minutes ago #

Ok,now work perfect
but I have another problem now , I want to deply post only when user get on the bottom not from scrolling slowly and showing posts without that animation
you can check it out here: http://9tanks.com
I want this because too many posts are deploy and that make site work slow.
Thanks.
I try to change Infinite Scroll Buffer (px) but same...
I want just when the user get on full bottom.

WordPress ...
ما را در سایت WordPress دنبال می کنید

برچسب : نویسنده : استخدام کار wpss بازدید : 134 تاريخ : سه شنبه 21 ارديبهشت 1395 ساعت: 21:55