Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #372003

    hi!
    Is there any possibility to have ALL items open on page load not just one.
    many thanks
    fritz

    #372156

    Hey Fritz!

    Please add following code to Functions.php file in Appearance > Editor

    function add_custom_toggle(){
    ?>
    <script>
    jQuery(window).load(function(){
    jQuery('.toggler').addClass('activeTitle');
    });
    </script>
    <?php
    }
    add_action('wp_footer', 'add_custom_toggle');

    Best regards,
    Yigit

    #372245

    Hi Yigit,
    this leads to strange effect, maybe because I’ve got two accordions on the page.
    But anyhow, your tipp was great. I just changed

    jQuery('.toggler').addClass('activeTitle');
    to

    jQuery('[data-fake-id="#toggle-id-1"]').addClass('activeTitle');
    jQuery('[data-fake-id="#toggle-id-2"]').addClass('activeTitle');

    thx, fritz

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Accordion / all items open on load’ is closed to new replies.