adobe-accessibility / Accessible-Mega-Menu

A demonstration of how to implement a keyboard and screen reader accessible mega menu as a jQuery plugin.
Apache License 2.0
605 stars 199 forks source link

Click Main Option to Open #30

Open austinstudio opened 9 years ago

austinstudio commented 9 years ago

Is there a way I can make it so you have to click or press enter/space to get the first level of the menu to open? I don't want it to happen on hover of the mouse. Most menu scripts I have seen have some parameters that can be set through JavaScript but I can't find any API with this one that does this.

Thank you in advance.

austinstudio commented 9 years ago

Does anyone review the items out here anymore?

austinstudio commented 9 years ago

Well I don't know if this is a good way to do this or not, but I changed the following in line 752 of the js file.

.on("mouseover.accessible-megamenu", $.proxy(_mouseOverHandler, this))

To:

.on("click.accessible-megamenu", $.proxy(_mouseOverHandler, this))

This seems to have worked but not sure if there is another way to do this that won't equal modifying the mouseover event.

tdhooper commented 9 years ago

This would be fixed by https://github.com/adobe-accessibility/Accessible-Mega-Menu/pull/27

austinstudio commented 9 years ago

Thanks for the response. I did the same eventually. I just figured there would be a better way.

tactics2 commented 8 years ago

I'm trying to do the same. I followed austinstudio's suggestion above and that opens the menu on first click, but I need it to close when the user clicks it again. Suggestions?

austinstudio commented 8 years ago

There might be another place where the close event is called that needs to also be changed.

NewJenk commented 8 years ago

Any luck solving this @tactics2?

I'm having the same issue.