PS – Im going to buy the PRO Version if that helps 🙂
Let’s see if we can get you pointed in the right direction:
1. The posts…are open on pageload and collapsed after the page finished loading
how long does it take for your page to load? On page load and after page finishes loading *should be* nearly the same moment. However, if the page is loading alot of content, try adding targclass=”maptastic” to the expand elements.
2. The search results and next page results are loaded via Ajax
A link would be helpful here. However, if the search results content is being loaded dynamically, then yes, there needs to be a function triggered once the content loads. This is called a callback, and it should look something like what was posted above.
Where did you get the callback:
jQuery(document).on("sf:ajaxfinish", ".searchandfilter", function(){
//magic goes here
});
This seems to only be bound to the .searchandfilter element. Is this the element where the content is being loaded into?
PS – Im going to buy the PRO Version if that helps
Going pro will connect you to personal support, if you need this resolved immediately, this is your best bet.
Thanks a lot!
Im bound to other projects now and it will take some time to test and get back to you. Stay tuned as I will post an answer. Thanks for your help!
Best,
Benedikt
Hello @twinpictures,
I added two classes to the collapse-o-matic content via the backend controls. The Targclass Attribute is now “my-beschreibung maptastic”. I changed the jQuery script code and added it via header and footer scripts:
<script>
jQuery(document).on("sf:ajaxfinish", ".my-beschreibung", function(){
collapse_init();
});
</script>
Is “element where the content is being loaded into” referring to a div class which is added to the target via “targclass”?
Thanks in advance!
Again, where are you getting this callback from?
Which theme/plugin is responsible for the Ajax loaded results, and where is the related documentation on:
jQuery(document).on("sf:ajaxfinish"...
If this is the correct callback, first verify that this is triggering on successful content load by calling something like:
jQuery(document).on("sf:ajaxfinish", ".my-beschreibung", function(){
alert('content loaded');
});
if an alert message pops up, then we know the sf:ajaxfinish callback is being correctly triggered.
Any update on this?
Without a link it’s really difficult to troubleshoot and provide possible solutions. We did, however, do a quick google search on sf:ajaxfinish; are you by chance using the search & filter pro plugin?
Hello there- thanks for your reply! Im sorry, took me some days, but now im back in business here and want to go ob with this. I purchased and installed the pro version and I guess we will go on via e-mail from here.
Best!
Pansenschim
Nice! We’ll mark this issue as resolved. And it will be, you’re in good hands.