Unable to catch event from the element

I’m trying to animate menu elements when off-canvas menu has opened.

Using this event from the documentation:
openedEnd.zf.offCanvas Fires when the off-canvas menu open transition is done.

Code I’ve used.

$('#offCanvas').on('openedEnd.zf.offCanvas', () => {
    console.log('animation function should be here');

But nothing has happened. I’ve tried another elements for catching the events - the same result.

What I’m doing wrong?

Hi, please provide more info like the exact Foundation version that you use.

Previous versions did not have this event. See https://github.com/foundation/foundation-sites/blob/b58d2354f54bb601f1b4ae7ee8536ac7ccfb18ba/js/foundation.offcanvas.js#L354 vs https://github.com/foundation/foundation-sites/blob/ef9389ea56bac2654b81e04b28f1cfad6d743c33/js/foundation.offcanvas.js#L480