Clickable Main Dropdown-Link


Topic: Clickable Main Dropdown-Link

BP-Webmedia pro asked 6 years ago

Hi, how can I make the main Dropdown item clickable like this: First click: dropdown opens Second click: locate to another page ex. google.com Thanks

BP-Webmedia pro answered 6 years ago

The solution is to detect the second click on the dropdown button/link and follow the link at that point: $('.navbar .dropdown > a').click(function() { if (!$(this).hasClass("parent-clicked")) { $(this).addClass("parent-clicked"); } else { location.href = this.href; } });

Piotr Glejzer staff answered 6 years ago

Hi, do you mean something like that? MDB Snippets - Dropdown Best, Piotr

BP-Webmedia pro answered 6 years ago

No not really. I mean the first point (as I marked on the picture) should point to another page on the second click.
Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Resolved

Specification of the issue
  • User: Pro
  • Premium support: No
  • Technology: General Bootstrap questions
  • MDB Version: -
  • Device: PC
  • Browser: All
  • OS: Mac/Win
  • Provided sample code: No
  • Provided link: No