Topic: Clickable Main Dropdown-Link

BP-Webmedia pro asked 5 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 5 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; } });

BP-Webmedia pro answered 5 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.

Piotr Glejzer staff answered 5 years ago


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

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

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