somewebmedia / hc-offcanvas-nav

JavaScript library for creating toggled off-canvas multi-level navigations, allowing endless nesting of submenu elements, supporting swipe gestures, keyboard interactions and ARIA attributes.
https://somewebmedia.github.io/hc-offcanvas-nav/
MIT License
336 stars 82 forks source link

Events not working inside menu #66

Open kapdom opened 3 years ago

kapdom commented 3 years ago

Hi. I would like to add event on click to one of the menu element. But it looks like all events are cleared by your scrips. How to allowed add 'click' event inside menu?

somewebmedia commented 3 years ago

They shouldn't be cleared. Can you provide some code I can see?

shadaabbhut commented 3 years ago

image image image

None of the events are working over menu items. please help me with this. this is important for me

shadaabbhut commented 3 years ago

@somewebmedia can you please help me regarding this issue?

somewebmedia commented 3 years ago

Are you attaching your events to the original navigation before or after you have called HC Off-canvas Nav?

5ulo commented 2 years ago

I have the same problem right now. addEventListener called on Nav open isn't working for clicks and taps

        Nav.on('open', function(e, settings) {
            let btn = document.getElementById('testMe');
            btn.addEventListener('click', () => {
                console.log('clicked');
            });
        });
5ulo commented 2 years ago

So I found events are working when removeOriginalNav: true is set.