He tenido un botón de cierre usando la base Toggler
https://get.foundation/sites/docs/toggler.html
¿Cómo en JS podría hacerle algo al DOM cuando se hace clic en el botón Cerrar?
He intentado algo como esto:
function handleToggler() { console.log('closing the panel'); } window.addEventListener( 'on.zf.toggler', handleToggler, );Pero esto no es.
Puede agregar un onclick al html:
<a data-toggle="menuBar" onclick="yourFunctionHere()">Expand!</a>Luego, simplemente acceda al nodo DOM al que desea hacer algo en la función:
function yourFunctionHere(e){ const a_div = document.getElementById("a_div"); }