Topic: Make Dropdown main point clickable
BP-Webmedia pro asked 7 years ago
Mikołaj Smoleński staff answered 7 years ago
<!-- Basic dropdown --> <div class="btn-group"> <button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown" data-href="https://mdbootstrap.com/material-design-for-bootstrap/" aria-haspopup="true" aria-expanded="false">Basic dropdown</button> <div class="dropdown-menu"> <a class="dropdown-item" href="#">Action</a> <a class="dropdown-item" href="#">Another action</a> <a class="dropdown-item" href="#">Something else here</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="#">Separated link</a> </div> </div>
<script> $(document).ready(function () { let count = 0; $('.dropdown-toggle').on('click', function() { count++; let url = $(this).attr('data-href'); if(count % 2 == 0) { window.open(url,'_blank'); } }) }); </script>Best Regards
BP-Webmedia pro answered 7 years ago
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Resolved
- User: Pro
- Premium support: No
- Technology: MDB jQuery
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: No