Menu icon Foundation
Foundation 6.1.2 Accordion Menu - How to do Callbacks

I'm trying to implement a simple callback when any Accordion Menu is opened or closed but can't seem to get it to fire.
I'm trying the following code but nothing happens:

$('[data-accordion-menu]').on('down.zf.accordionmenu', function() { 
    console.log('Accordion triggered!');
});      

Any pointers would be appreciated.

Codepen here:
http://codepen.io/logopogo/pen/yemqGZ

accordion menufoundation 6

I'm trying to implement a simple callback when any Accordion Menu is opened or closed but can't seem to get it to fire.
I'm trying the following code but nothing happens:

$('[data-accordion-menu]').on('down.zf.accordionmenu', function() { 
    console.log('Accordion triggered!');
});      

Any pointers would be appreciated.

Codepen here:
http://codepen.io/logopogo/pen/yemqGZ

Jos Kelleners almost 3 years ago

I was trying to do a destroy of an accordion object. but I cannot get this to work either. Would be nice to have a simple example.