CSS-Circle-Menu icon indicating copy to clipboard operation
CSS-Circle-Menu copied to clipboard

event listener on menu icons

Open hassanItani opened this issue 9 years ago • 3 comments

hey dude, how can i handle the click on menu icons

hassanItani avatar Jan 02 '16 12:01 hassanItani

Here's my silly solution, given one menu icon:

<li class="c-circle-nav__item">
  <a href="#" class="c-circle-nav__link" onClick="events.emit('clickHome');">
    <img src="assets/img/menu_icon/house.svg" alt="">
  </a>
</li>

of course you can specify whatever function you want on the HTML onClick attribute.

roccomuso avatar Jan 11 '16 15:01 roccomuso

Simple solution, but I'd rather refactor into something more robust. Definitely some kind of option that takes a callback, and leverage a data attribute of some sort. I'll pen this in as a feature.

callmenick avatar Jan 11 '16 16:01 callmenick

A little late, but you can also just add an event listener to the menu items

ElliGator avatar Jun 14 '16 16:06 ElliGator