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
Add comment
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;
}
});
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.
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