Okay
  Public Ticket #3360771
accordion animation in agenda list view
Closed

Comments

  •  1
    René started the conversation

    Hello together

    Our customer does not want the animation in the agenda list view. is there any way to disable the animation?

    Sorry but I didn't find any setting, so the question via ticket.

    Thanks in advance
    René

  •  894
    Zhivko replied

    Hi,

    You could achieve this via a custom hook.

    Open your theme or child-theme functions.php file and at the bottom place:

    /**
     * Disable accordeon animation on agenda list
     */
    add_action('wp_footer', function () {
        if (!wp_script_is('stec-js')) {
            return '';
        }
        ?>
        <script type="text/javascript">
            (function($) {
                $(function() {
                    if (typeof $.stecExtend !== 'function') {
                        return;
                    }
                    $.stecExtend(function(m) {
                        m.helper.animate.agenda.fillList = function($container, callback, instant) {
                            var $events = $container
                                .find('.stec-layout-agenda-events-all')
                                .find('.stec-layout-event-preview')
                                .not('.stec-layout-event-preview-animate-complete');
                            $events.addClass('stec-layout-event-preview-animate-complete');
                            if (typeof callback === 'function') {
                                callback();
                            }
                        }
                    });
                });
            })(jQuery);
        </script>
    <?php
    });
    

    Stachethemes Developer

  •  1
    René replied

    Thanks a lot


    It works great but only when you are logged into the backend.

    in the frontend as a visitor this measure shows no effect. The animation is still there.

    The cache in the backend and in the browser is cleared several times, all plugins deactivated and reactivated - without success.

    Is there anything else I need to consider?

  •  894
    Zhivko replied

    I think this is happening because of this error:

    2887006595.png

    It seems like the Moment library is being deferred on your website:

    7098184191.png

    Please ensure that you are not deferring this script, as it causes issues with your website's functionality. It's possible that this setting was enabled by a plugin you are using for optimization purposes.


    Stachethemes Developer

  •  1
    René replied

    You are just brilliant, thank you so much it works.

    We are using WP Rocket and I have disabled the "Load JavaScript Files deferred" option.
    Maybe it will help others as well, so I'm posting an image about it.

    Kind Regards
    René

    Attached files:  WP Rocket Settings.jpg