cwspear/bootstrap-hover-dropdown
jQuery plugin that brings Bootstrap dropdowns to life on hover. Adds configurable delay, menu close on mouseout, and touch-friendly behavior while keeping Bootstrap’s markup and styles. Useful for navbars and multi-level menus.
@vite(['resources/js/bootstrap-hover-dropdown.js', 'resources/css/bootstrap-hover-dropdown.css'])
Or via CDN:
<script src="https://cdn.jsdelivr.net/npm/bootstrap-hover-dropdown@2.1.1/dist/js/bootstrap-hover-dropdown.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-hover-dropdown@2.1.1/dist/css/bootstrap-hover-dropdown.min.css">
| Risk Area | Severity | Mitigation Strategy |
|---|---|---|
| Bootstrap Version Mismatch | Medium | Test with your Bootstrap version (4 vs. 5). |
| jQuery/Popper.js Missing | High | Audit package.json or composer.json for dependencies. |
| CSS Conflicts | Medium | Use browser dev tools to inspect overrides. |
| Dynamic Content Issues | Medium | Implement $(document).on('hover-dropdown-init', ...) for SPAs. |
| Performance Overhead | Low | Minimal JS/CSS; negligible impact on LCP. |
| Component | Compatibility Notes |
|---|---|
| Bootstrap 4 | Fully supported (requires jQuery). |
| Bootstrap 5 | Supported (uses Popper.js; no jQuery). |
| Laravel Mix/Vite | Works with both; ensure assets are compiled/enqueued correctly. |
| Livewire | Requires wire:ignore or manual JS initialization after updates. |
| Alpine.js | May conflict with hover events; test thoroughly. |
| Mobile | Includes touch-event fallback (configurable delay). |
$(function() {
$('[data-toggle="dropdown"]').hoverDropdown();
});
hover, mouseleave).!important overrides).hoverDelay config..hover-dropdown-menu).hoverDelay, closeOnScroll).| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Bootstrap version mismatch | Dropdowns break | Test in staging; use polyfills if needed. |
| jQuery/Popper.js missing | JS errors | Audit webpack.mix.js or vite.config.js. |
| CSS conflicts | Styling breaks | Inspect overrides; use !important sparingly. |
| Dynamic content not reinitialized | Hover fails on AJAX updates | Use event delegation (e.g., MutationObserver). |
| Mobile touch delay too short | Accidental clicks | Configure hoverDelay in JS. |
hoverDelay, closeOnScroll).How can I help you explore Laravel packages today?