Click here to Skip to main content
15,791,353 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have tried from last few days but unable to open megamenu on click of ahref link, after done some code checkup, i have found some hint in css, in that if i make visibility value to visible then megamenu shows otherwise not, i want that menu to be open only on click right now it's opening on hover event and below code to be executed only onclick of ahref tag[^]
Below is the ref. menu image

What I have tried:

.menu-subs, .menu-column-4 
    visibility: hidden!important;   
Updated 29-Jun-22 4:43am

1 solution

This isn't likely to be achievable through CSS alone. There is a really, really obscure hack which involves using hidden checkboxes and CSS sibling selectors, but what you're asking for here is a link click to open a menu of sorts. It sounds like you're going to need to use Javascript to accomplish this. Depending on what sort of menu you're after (whether it's a dropdown or a flyout) you'll need to have a search online to find one that suits your needs.

Bootstrap offers dropdown/menu support out of the box (Navbar · Bootstrap[^]) if you're open to using it, otherwise you'll have to use Google to find what you need!
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900