• Resolved alvarokid

    (@alvarokid)


    Hi,

    My content is expanded by default and I need it to appear hidden/collapsed and if user click, there expand the content. I think that was the way it was before since it should be the default behavior but for some reason now it works the other way around. I seem unable to “force” to appear collapsed when the page is loaded.

    You can see it here: https://www.hooksounds.com/checkout/

    I appreciate your help.

    Regards,

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author twinpictures

    (@twinpictures)

    the reason the expand elements are not initially collapsed, is the content is loaded dynamically. Where exactly are you placing the short code? on the checkout page, or in the checkout form that only loads if items are in the cart?

    Thread Starter alvarokid

    (@alvarokid)

    Hi,

    Shortcode is placed after <fieldset> form start.

    Actually I do it through add_action before and after the form without shortcode.

    This is the code:

    function collapse_before ( ) {
    echo '<p class="collapseomatic  colomat-visited" id="some_id" rel="button-highlander" title="Create my account">Create my account</p>';
    echo '<div id="target-some_id" class="collapseomatic_content ">';
    }
    
    function collapse_after ( ) {
    echo '</div>';
    }
    
    add_action( 'edd_register_fields_before', 'collapse_before' );
    add_action( 'edd_register_fields_after', 'collapse_after' );
    Plugin Author twinpictures

    (@twinpictures)

    Wow, this was never answered… sorry about that.
    Are you able to trigger a javascript callback once your shopping cart loads dynamically?

    Since you are using Easy Digital Downloads it seems the function in question is edd_load_checkout_login_fields

    You simply need to call the collapse_init() javascript function on successful content load. You might want to contact EDD to see of they have a callback you can hook into.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Default content is expanded’ is closed to new replies.