Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Baden

    (@baden03)

    Sure, you simply need to re initialize the collapse function once the content has finished loading. Does your AJAX call have a callback function you can hook into?

    The function you need trigger from the callback is:

    collapse_init();

    Let us know if you need any further direction on this, or if you get is figured out!

    Thread Starter AlanP57

    (@alanp57)

    Please talk a look at the page and you will see that I am already doing that and it is not working:

    https://dipy.alan.medinsight.org/en/research-test/

    success: function (data) {
    jQuery(“#content”).css(‘height’, ”);
    jQuery(“#research_items”).html(data);

    collapse_init();

    Thread Starter AlanP57

    (@alanp57)

    Never mind. We will come up with our own way to expand the text.

    Plugin Author Baden

    (@baden03)

    what does the function look like that generates your data?
    in other words, how exactly are you grabbing your post content in the ajax function?

    It seems you are going a different rout. For others that have this issue:

    1. make sure that you are either applying the_content filter to your post data, or are passing it through the do_shortcode function.
    2. be sure you are loading the collapse-o-matic script on all pages, not just when the shortcode is used.
    3. call the collapse_init(); once the page has been populated with the new data.

    Issue marked as resolved.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Initializing Collapse-O-Matic after AJAX call’ is closed to new replies.