需要关闭所有已打开的下拉菜单,然后再打开另一个。

huangapple go评论95阅读模式
英文:

In Nav need to close all other dropdowns which are open, while opening another

问题

I have multiple dropdowns within a top level dropdown menu. I have an issue where when I click to open one submenu, it remains open when I click to open another. Would like to auto close the others when another submenu is clicked open.

我的顶级下拉菜单中有多个下拉菜单项。当我点击打开一个子菜单时,另一个子菜单保持打开状态。希望在点击打开另一个子菜单时自动关闭其他子菜单。

Here is the translation for the provided HTML code:

这是提供的HTML代码的翻译:

  1. <nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark">
  2. <div class="container-fluid"> <a class="navbar-brand" href="#"> LOGO </a>
  3. <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarCollapse" aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button>
  4. <!-- start test -->
  5. <div class="row navbar-collapse" id="navbarCollapse">
  6. <div class="col-md-12 order-last menu-one">
  7. <!-- start -->
  8. <ul class="navbar-nav ms-auto mb-2 mb-md-0 nav navbar-right justify-content-end">
  9. <hr class="white d-block d-md-none">
  10. <li class="nav-item"> <a class="nav-link active" aria-current="page" href="#">登录</a> </li>
  11. <li class="nav-item"> <a class="nav-link" href="#">支持 <span class="text-ltred">1300 000 123</span></a> </li>
  12. <li class="nav-item dropdown"> <a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">全球站点</a>
  13. <ul class="dropdown-menu dropdown-menu-end">
  14. <li><a class="dropdown-item" href="#">美国/加拿大</a></li>
  15. <li><a class="dropdown-item" href="#">新西兰</a></li>
  16. </ul>
  17. </li>
  18. <li class="nav-item" id="search">
  19. <div class="search-box nav-link">
  20. <input type="text" class="search-input" placeholder="搜索">
  21. <a class="search-btn" href="#"> ? </a> </div>
  22. </li>
  23. </ul>
  24. <!-- end -->
  25. </div>
  26. <div class="col-md-12 order-md-last menu-two">
  27. <!-- start -->
  28. <ul class="navbar-nav ms-auto mb-2 mb-md-0 nav navbar-right justify-content-end">
  29. <li class="nav-item dropdown has-megamenu"> <a class="nav-link dropdown-toggle" href="#" data-bs-toggle="dropdown">解决方案和服务</a>
  30. <div class="dropdown-menu megamenu" role="menu">
  31. <div class="row g-3">
  32. <div class="col-md-6 col-12">
  33. <div class="col-megamenu">
  34. <h6 class="title">解决方案和服务</h6>
  35. <ul class="list-unstyled">
  36. <li class="dropend"> <a href="#" class="dropdown-item dropdown-toggle" data-bs-toggle="dropdown" aria-haspopup="true" data-bs-auto-close="true" aria-expanded="false">租赁解决方案</a>
  37. <ul class="dropdown-menu no-border">
  38. <li><a class="dropdown-item" href="">转移我的车队</a></li>
  39. <li><a class="dropdown-item" href="">开始新车队</a></li>
  40. <li><a class="dropdown-item" href="">电动车辆</a></li>
  41. <li><a class="dropdown-item" href="">下一次租赁</a></li>
  42. <li><a class="dropdown-item" href="">卡车、设备</a></li>
  43. <li><a class="dropdown-item" href="">二手车</a></li>
  44. </ul>
  45. </li>
  46. <li class="dropend"> <a href="#" class="dropdown-item dropdown-toggle" data-bs-toggle="dropdown" aria-haspopup="true" data-bs-auto-close="true" aria-expanded="false">车队管理服务</a>
  47. <ul class="dropdown-menu no-border">
  48. <li><a class="dropdown-item" href="">事故管理</a></li>
  49. <li><a class="dropdown-item" href="">采购和处置</a></li>
  50. <li><a class="dropdown-item" href="">驾驶员安全</a></li>
  51. <li><a class="dropdown-item" href="">车队卡</a></li>
  52. <li><a class="dropdown-item" href="">租车</a></li>
  53. <li><a class="dropdown-item" href="">违规管理</a></li>
  54. <li><a class="dropdown-item" href="">保险</a></li>
  55. <li><a class="dropdown-item" href="">维护</a></li>
  56. <li><a class="dropdown-item" href="">PoolCar共享平台</a></li>
  57. <li><a class="dropdown-item" href="">注册</a></li>
  58. <li><a class="dropdown-item" href="">道路救援</a></li>
  59. <li><a class="dropdown-item" href="">远程监控</a></li>
  60. <li><a class="dropdown-item" href="">收费管理</a></li>
  61. </ul>
  62. </li>
  63. <li class="dropend"> <a href="#" class="dropdown-item dropdown-toggle" data-bs-toggle="dropdown" aria-haspopup="true" data-bs-auto-close="true" aria-expanded="false">车队优化</a>
  64. <ul class="dropdown-menu no-border">
  65. <li><a class="dropdown-item" href="">企业融资</a></li>
  66. <li><a class="dropdown-item" href="">租赁</a></li>
  67. <li><a class="dropdown-item" href="">销售和租赁回购</a></li>
  68. <li><a class="dropdown-item" href="">战略咨询</a></li>
  69. <li><a class="dropdown-item" href="">技术集成</a></li>
  70. </ul>
  71. </li>
  72. </ul>
  73. </div>
  74. <!-- col-megamenu.// -->
  75. </div>
  76. <!-- end col-3 -->
  77. </div>
  78. <!-- end row -->
  79. </div>
  80. <!-- dropdown-mega-menu.// -->
  81. </li>
  82. <li class="nav-item"> <a class="nav-link" href="#">司机支
  83. <details>
  84. <summary>英文:</summary>
  85. I have multiple dropdowns within a top level dropdown menu. I have an issue where when I click to open one submenu, it remains open when I click to open another. Would like to auto close the others when another submenu is clicked open.
  86. MY HTML:

<nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark">
<div class="container-fluid"> <a class="navbar-brand" href="#"> LOGO </a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarCollapse" aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button>

  1. &lt;!-- start test --&gt;
  2. &lt;div class=&quot;row navbar-collapse&quot; id=&quot;navbarCollapse&quot;&gt;
  3. &lt;div class=&quot;col-md-12 order-last menu-one&quot;&gt;
  4. &lt;!-- start--&gt;
  5. &lt;ul class=&quot;navbar-nav ms-auto mb-2 mb-md-0 nav navbar-right justify-content-end&quot;&gt;
  6. &lt;hr class=&quot;white d-block d-md-none&quot;&gt;
  7. &lt;li class=&quot;nav-item&quot;&gt; &lt;a class=&quot;nav-link active&quot; aria-current=&quot;page&quot; href=&quot;#&quot;&gt;login &lt;/a&gt; &lt;/li&gt;
  8. &lt;li class=&quot;nav-item&quot;&gt; &lt;a class=&quot;nav-link&quot; href=&quot;#&quot;&gt;support &lt;span class=&quot;text-ltred&quot;&gt;1300 000 123&lt;/span&gt;&lt;/a&gt; &lt;/li&gt;
  9. &lt;li class=&quot;nav-item dropdown&quot;&gt; &lt;a class=&quot;nav-link dropdown-toggle&quot; href=&quot;#&quot; role=&quot;button&quot; data-bs-toggle=&quot;dropdown&quot; aria-expanded=&quot;false&quot;&gt; Global sites &lt;/a&gt;
  10. &lt;ul class=&quot;dropdown-menu dropdown-menu-end&quot;&gt;
  11. &lt;li&gt;&lt;a class=&quot;dropdown-item&quot; href=&quot;#&quot;&gt;United States / Canada&lt;/a&gt;&lt;/li&gt;
  12. &lt;li&gt;&lt;a class=&quot;dropdown-item&quot; href=&quot;#&quot;&gt;New Zealand&lt;/a&gt;&lt;/li&gt;
  13. &lt;/ul&gt;
  14. &lt;/li&gt;
  15. &lt;li class=&quot;nav-item&quot; id=&quot;search&quot;&gt;
  16. &lt;div class=&quot;search-box nav-link&quot;&gt;
  17. &lt;input type=&quot;text&quot; class=&quot;search-input&quot; placeholder=&quot;Search&quot;&gt;
  18. &lt;a class=&quot;search-btn&quot; href=&quot;#&quot;&gt; ? &lt;/a&gt; &lt;/div&gt;
  19. &lt;/li&gt;
  20. &lt;/ul&gt;
  21. &lt;!-- end --&gt;
  22. &lt;/div&gt;
  23. &lt;div class=&quot;col-md-12 order-md-last menu-two&quot;&gt;
  24. &lt;!-- start--&gt;
  25. &lt;ul class=&quot;navbar-nav ms-auto mb-2 mb-md-0 nav navbar-right justify-content-end&quot;&gt;
  26. &lt;li class=&quot;nav-item dropdown has-megamenu&quot;&gt; &lt;a class=&quot;nav-link dropdown-toggle&quot; href=&quot;#&quot; data-bs-toggle=&quot;dropdown&quot;&gt;Solutions &amp;amp; services&lt;/a&gt;
  27. &lt;div class=&quot;dropdown-menu megamenu&quot; role=&quot;menu&quot;&gt;
  28. &lt;div class=&quot;row g-3&quot;&gt;
  29. &lt;div class=&quot;col-md-6 col-12&quot;&gt;
  30. &lt;div class=&quot;col-megamenu&quot;&gt;
  31. &lt;h6 class=&quot;title&quot;&gt;Solutions &amp;amp; services&lt;/h6&gt;
  32. &lt;ul class=&quot;list-unstyled&quot;&gt;
  33. &lt;li class=&quot;dropend&quot;&gt; &lt;a href=&quot;#&quot; class=&quot;dropdown-item dropdown-toggle&quot; data-bs-toggle=&quot;dropdown&quot; aria-haspopup=&quot;true&quot; data-bs-auto-close=&quot;true&quot; aria-expanded=&quot;false&quot;&gt;Leasing solutions&lt;/a&gt;
  34. &lt;ul class=&quot;dropdown-menu no-border&quot;&gt;
  35. &lt;li&gt;&lt;a class=&quot;dropdown-item&quot; href=&quot;&quot;&gt; Transfer my fleet&lt;/a&gt;&lt;/li&gt;
  36. &lt;li&gt;&lt;a class=&quot;dropdown-item&quot; href=&quot;&quot;&gt; Start a new fleet&lt;/a&gt;&lt;/li&gt;
  37. &lt;li&gt;&lt;a class=&quot;dropdown-item&quot; href=&quot;&quot;&gt; Electric vehicles&lt;/a&gt;&lt;/li&gt;
  38. &lt;li&gt;&lt;a class=&quot;dropdown-item&quot; href=&quot;&quot;&gt; Next lease&lt;/a&gt;&lt;/li&gt;
  39. &lt;li&gt;&lt;a class=&quot;dropdown-item&quot; href=&quot;&quot;&gt; Trucks, plant &amp;amp; equipment&lt;/a&gt;&lt;/li&gt;
  40. &lt;li&gt;&lt;a class=&quot;dropdown-item&quot; href=&quot;&quot;&gt; Used vehicles&lt;/a&gt;&lt;/li&gt;
  41. &lt;/ul&gt;
  42. &lt;/li&gt;
  43. &lt;li class=&quot;dropend&quot;&gt; &lt;a href=&quot;#&quot; class=&quot;dropdown-item dropdown-toggle&quot; data-bs-toggle=&quot;dropdown&quot; aria-haspopup=&quot;true&quot; data-bs-auto-close=&quot;true&quot; aria-expanded=&quot;false&quot;&gt;Fleet management services&lt;/a&gt;
  44. &lt;ul class=&quot;dropdown-menu no-border&quot;&gt;
  45. &lt;li&gt;&lt;a class=&quot;dropdown-item&quot; href=&quot;&quot;&gt; Accident management&lt;/a&gt;&lt;/li&gt;
  46. &lt;li&gt;&lt;a class=&quot;dropdown-item&quot; href=&quot;&quot;&gt; Acquisition and disposals&lt;/a&gt;&lt;/li&gt;
  47. &lt;li&gt;&lt;a class=&quot;dropdown-item&quot; href=&quot;&quot;&gt; Driver safety&lt;/a&gt;&lt;/li&gt;
  48. &lt;li&gt;&lt;a class=&quot;dropdown-item&quot; href=&quot;&quot;&gt; Fleet card&lt;/a&gt;&lt;/li&gt;
  49. &lt;li&gt;&lt;a class=&quot;dropdown-item&quot; href=&quot;&quot;&gt; Hire vehicles&lt;/a&gt;&lt;/li&gt;
  50. &lt;li&gt;&lt;a class=&quot;dropdown-item&quot; href=&quot;&quot;&gt; Infringement management&lt;/a&gt;&lt;/li&gt;
  51. &lt;li&gt;&lt;a class=&quot;dropdown-item&quot; href=&quot;&quot;&gt; Insurance&lt;/a&gt;&lt;/li&gt;
  52. &lt;li&gt;&lt;a class=&quot;dropdown-item&quot; href=&quot;&quot;&gt; Maintenance&lt;/a&gt;&lt;/li&gt;
  53. &lt;li&gt;&lt;a class=&quot;dropdown-item&quot; href=&quot;&quot;&gt; PoolCar sharing platform&lt;/a&gt;&lt;/li&gt;
  54. &lt;li&gt;&lt;a class=&quot;dropdown-item&quot; href=&quot;&quot;&gt; Registration&lt;/a&gt;&lt;/li&gt;
  55. &lt;li&gt;&lt;a class=&quot;dropdown-item&quot; href=&quot;&quot;&gt; Roadside assistance&lt;/a&gt;&lt;/li&gt;
  56. &lt;li&gt;&lt;a class=&quot;dropdown-item&quot; href=&quot;&quot;&gt; Telematics&lt;/a&gt;&lt;/li&gt;
  57. &lt;li&gt;&lt;a class=&quot;dropdown-item&quot; href=&quot;&quot;&gt; Toll management&lt;/a&gt;&lt;/li&gt;
  58. &lt;/ul&gt;
  59. &lt;/li&gt;
  60. &lt;li class=&quot;dropend&quot;&gt; &lt;a href=&quot;#&quot; class=&quot;dropdown-item dropdown-toggle&quot; data-bs-toggle=&quot;dropdown&quot; aria-haspopup=&quot;true&quot; data-bs-auto-close=&quot;true&quot; aria-expanded=&quot;false&quot;&gt;Fleet optimisation&lt;/a&gt;
  61. &lt;ul class=&quot;dropdown-menu no-border&quot;&gt;
  62. &lt;li&gt;&lt;a class=&quot;dropdown-item&quot; href=&quot;&quot;&gt; Corporate financing&lt;/a&gt;&lt;/li&gt;
  63. &lt;li&gt;&lt;a class=&quot;dropdown-item&quot; href=&quot;&quot;&gt; Leasing&lt;/a&gt;&lt;/li&gt;
  64. &lt;li&gt;&lt;a class=&quot;dropdown-item&quot; href=&quot;&quot;&gt; Sales and lease back&lt;/a&gt;&lt;/li&gt;
  65. &lt;li&gt;&lt;a class=&quot;dropdown-item&quot; href=&quot;&quot;&gt; Strategic consulting&lt;/a&gt;&lt;/li&gt;
  66. &lt;li&gt;&lt;a class=&quot;dropdown-item&quot; href=&quot;&quot;&gt; Technology integration&lt;/a&gt;&lt;/li&gt;
  67. &lt;/ul&gt;
  68. &lt;/li&gt;
  69. &lt;/ul&gt;
  70. &lt;/div&gt;
  71. &lt;!-- col-megamenu.// --&gt;
  72. &lt;/div&gt;
  73. &lt;!-- end col-3 --&gt;
  74. &lt;/div&gt;
  75. &lt;!-- end row --&gt;
  76. &lt;/div&gt;
  77. &lt;!-- dropdown-mega-menu.// --&gt;
  78. &lt;/li&gt;
  79. &lt;li class=&quot;nav-item&quot;&gt; &lt;a class=&quot;nav-link&quot; href=&quot;#&quot;&gt;Driver Support&lt;/a&gt;&lt;/li&gt;
  80. &lt;li class=&quot;nav-item&quot;&gt; &lt;a class=&quot;nav-link&quot; href=&quot;#&quot;&gt;About&lt;/a&gt;&lt;/li&gt;
  81. &lt;li class=&quot;nav-item&quot;&gt; &lt;a class=&quot;nav-link&quot; href=&quot;#&quot;&gt;News&lt;/a&gt;&lt;/li&gt;
  82. &lt;li class=&quot;nav-item&quot;&gt; &lt;a class=&quot;nav-link&quot; href=&quot;#&quot;&gt;Resources&lt;/a&gt;&lt;/li&gt;
  83. &lt;li class=&quot;nav-item&quot;&gt; &lt;a class=&quot;btn btn-bd-primary&quot; href=&quot;#&quot; role=&quot;button&quot;&gt;Contact us&lt;/a&gt;&lt;/li&gt;
  84. &lt;/ul&gt;
  85. &lt;!-- end --&gt;
  86. &lt;/div&gt;
  87. &lt;/div&gt;
  88. &lt;!-- end test --&gt;

</div>
</nav>

  1. You can see the full code I have at:
  2. https://www.codeply.com/p/YfWQ2HX73q
  3. I am stuck, and really would like the help to get this menu working beautifully.
  4. </details>
  5. # 答案1
  6. **得分**: 0
  7. 使用 `for` 循环来遍历具有 `className=dropdown-menu` 的元素,并相应地更改它的 `className`
  8. 例如:
  9. ```javascript
  10. Array.from(document.querySelectorAll(".dropdown-menu")).forEach((e) => {
  11. e.className == "hide"
  12. ? e.className == "show"
  13. : e.className == "hide";
  14. })
英文:

use for loop to iterate through the elements with className=dropdown-menu and change it className accordingly

eg:

  1. Array.from(document.querySelectorAll(&quot;.dropdown-menu&quot;)).forEach((e)=&gt;{
  2. e.className==&quot;hide&quot;
  3. ?e.className==&quot;show&quot;
  4. :e.className==&quot;hide&quot;
  5. })

答案2

得分: 0

将所有子菜单放入列表中,然后添加点击监听器,当点击时,关闭列表中除被点击的之外的所有子菜单:

  1. const subMenus = [];
  2. document.querySelectorAll('.dropend .dropdown-toggle').forEach(function(menu, index) {
  3. subMenus.push(new bootstrap.Dropdown(menu));
  4. menu.addEventListener('click', function(e) {
  5. for (let i = 0; i < subMenus.length; i++) {
  6. if (i !== index) subMenus[i].hide();
  7. }
  8. });
  9. });

工作示例:

  1. <!-- begin snippet: js hide: false console: true babel: false -->
  2. <!-- language: lang-js -->
  3. document.addEventListener("DOMContentLoaded", function() {
  4. /////// Prevent closing from click inside dropdown
  5. document.querySelectorAll('.dropdown-menu').forEach(function(element) {
  6. element.addEventListener('click', function(e) {
  7. e.stopPropagation();
  8. });
  9. })
  10. const subMenus = [];
  11. document.querySelectorAll('.dropend .dropdown-toggle').forEach(function(menu, index) {
  12. subMenus.push(new bootstrap.Dropdown(menu));
  13. menu.addEventListener('click', function(e) {
  14. for (let i = 0; i < subMenus.length; i++) {
  15. if (i !== index) subMenus[i].hide();
  16. }
  17. });
  18. });
  19. // make it as accordion for smaller screens
  20. if (window.innerWidth < 992) {
  21. // close all inner dropdowns when parent is closed
  22. document.querySelectorAll('.navbar .dropdown').forEach(function(everydropdown){
  23. everydropdown.addEventListener('hidden.bs.dropdown', function () {
  24. // after dropdown is hidden, then find all submenus
  25. this.querySelectorAll('.submenu').forEach(function(everysubmenu){
  26. // hide every submenu as well
  27. everysubmenu.style.display = 'none';
  28. });
  29. })
  30. });
  31. document.querySelectorAll('.dropdown-menu a').forEach(function(element){
  32. element.addEventListener('click', function (e) {
  33. let nextEl = this.nextElementSibling;
  34. if(nextEl && nextEl.classList.contains('submenu')) {
  35. // prevent opening link if link needs to open dropdown
  36. e.preventDefault();
  37. console.log(nextEl);
  38. if(nextEl.style.display == 'block'){
  39. nextEl.style.display = 'none';
  40. } else {
  41. nextEl.style.display = 'block';
  42. }
  43. }
  44. });
  45. })
  46. }
  47. // end if innerWidth
  48. });
  1. <!-- language: lang-css -->
  2. html {
  3. overflow-x: hidden;
  4. }
  5. body {
  6. padding-right: 0 !important;
  7. font-family: "Cera-PRO-Regular", Arial, sans-serif;
  8. font-weight: 300 !important;
  9. font-size: 1rem;
  10. line-height: 1.6;
  11. overflow-x: hidden;
  12. margin-top: 70px;
  13. }
  14. .navbar-collapse.in {
  15. max-height: 100%;
  16. }
  17. .no-border {
  18. border: none;
  19. }
  20. .menu-two li a.nav-link {
  21. color: white !important;
  22. }
  23. .navbar-collapse {
  24. padding-top: 70px;
  25. padding-left: 40px;
  26. padding-right: 40px;
  27. }
  28. .dropdown-menu li a {
  29. text-decoration: none;
  30. padding-left: 15px;
  31. font-weight: 400;
  32. color: #000;
  33. }
  34. .dropdown-menu {
  35. --bs-dropdown-padding-y: 0;
  36. }
  37. @media (min-width: 768px) {
  38. body {
  39. margin-top: 40px;
  40. }
  41. .navbar-collapse {
  42. float: left;
  43. width: 100%;
  44. clear: both;
  45. }
  46. .navbar-inverse {
  47. border-top: 50px solid pink;
  48. }
  49. }
  50. .second-nav {
  51. margin-top: 40px;
  52. }
  53. li#search.nav-item {
  54. margin-left: 0;
  55. }
  56. .navbar {
  57. height: auto;
  58. }
  59. div.search-box.nav-link {
  60. margin-top: 30px;
  61. }
  62. nav ul,
  63. .dropdown-menu li a {
  64. font-size: 0.875rem;
  65. font-weight: 700;
  66. padding: var(--bs-dropdown-item-padding-y) var(--bs-dropdown-item-padding-x);
  67. display: block;
  68. }
  69. .text-red {
  70. color: #D6001C;
  71. }
  72. .text-ltred {
  73. color: #FF435C;
  74. }
  75. .text-white {
  76. color: #fff;
  77. }
  78. .dropend .dropdown-menu[data-bs-popper] {
  79. background-color: lightgrey;
  80. }
  81. @media (min-width: 576px) {
  82. .navbar {
  83. height: auto;
  84. }
  85. li#search.nav-item {
  86. margin-left: 0;
  87. }
  88. div.search-box.nav-link {
  89. margin-top: 30px;
  90. }
  91. .navbar-expand-md .navbar-nav .nav-link {
  92. margin-right: 0.2rem;
  93. margin-left: 0.2rem;
  94. padding-right: 0;
  95. padding-left: 0;
  96. }
  97. }
  98. @media (min-width: 768px) {
  99. .navbar {
  100. height: 40px;
  101. }
  102. .navbar-brand img {
  103. <details>
  104. <summary>英文:</summary>
  105. Get all submenus into a list, and then add click listener, and on click, close all submenus in the list, but the one that is clicked:
  106. const subMenus = [];
  107. document.querySelectorAll(&#39;.dropend .dropdown-toggle&#39;).forEach(function(menu, index) {
  108. subMenus.push(new bootstrap.Dropdown(menu));
  109. menu.addEventListener(&#39;click&#39;, function(e) {
  110. for (let i = 0; i &lt; subMenus.length; i++) {
  111. if (i !== index) subMenus[i].hide();
  112. }
  113. });
  114. });
  115. working snippet:
  116. &lt;!-- begin snippet: js hide: false console: true babel: false --&gt;
  117. &lt;!-- language: lang-js --&gt;
  118. document.addEventListener(&quot;DOMContentLoaded&quot;, function() {
  119. /////// Prevent closing from click inside dropdown
  120. document.querySelectorAll(&#39;.dropdown-menu&#39;).forEach(function(element) {
  121. element.addEventListener(&#39;click&#39;, function(e) {
  122. e.stopPropagation();
  123. });
  124. })
  125. const subMenus = [];
  126. document.querySelectorAll(&#39;.dropend .dropdown-toggle&#39;).forEach(function(menu, index) {
  127. subMenus.push(new bootstrap.Dropdown(menu));
  128. menu.addEventListener(&#39;click&#39;, function(e) {
  129. for (let i = 0; i &lt; subMenus.length; i++) {
  130. if (i !== index) subMenus[i].hide();
  131. }
  132. });
  133. });
  134. // make it as accordion for smaller screens
  135. if (window.innerWidth &lt; 992) {
  136. // close all inner dropdowns when parent is closed
  137. document.querySelectorAll(&#39;.navbar .dropdown&#39;).forEach(function(everydropdown){
  138. everydropdown.addEventListener(&#39;hidden.bs.dropdown&#39;, function () {
  139. // after dropdown is hidden, then find all submenus
  140. this.querySelectorAll(&#39;.submenu&#39;).forEach(function(everysubmenu){
  141. // hide every submenu as well
  142. everysubmenu.style.display = &#39;none&#39;;
  143. });
  144. })
  145. });
  146. document.querySelectorAll(&#39;.dropdown-menu a&#39;).forEach(function(element){
  147. element.addEventListener(&#39;click&#39;, function (e) {
  148. let nextEl = this.nextElementSibling;
  149. if(nextEl &amp;&amp; nextEl.classList.contains(&#39;submenu&#39;)) {
  150. // prevent opening link if link needs to open dropdown
  151. e.preventDefault();
  152. console.log(nextEl);
  153. if(nextEl.style.display == &#39;block&#39;){
  154. nextEl.style.display = &#39;none&#39;;
  155. } else {
  156. nextEl.style.display = &#39;block&#39;;
  157. }
  158. }
  159. });
  160. })
  161. }
  162. // end if innerWidth
  163. });
  164. &lt;!-- language: lang-css --&gt;
  165. html {
  166. overflow-x: hidden;
  167. }
  168. body {
  169. padding-right: 0 !important;
  170. font-family: &quot;Cera-PRO-Regular&quot;, Arial, sans-serif;
  171. font-weight: 300 !important;
  172. font-size: 1rem;
  173. line-height: 1.6;
  174. overflow-x: hidden;
  175. margin-top: 70px;
  176. }
  177. .navbar-collapse.in {
  178. max-height: 100%;
  179. }
  180. .no-border {
  181. border: none;
  182. }
  183. .menu-two li a.nav-link {
  184. color: white !important;
  185. }
  186. .navbar-collapse {
  187. padding-top: 70px;
  188. padding-left: 40px;
  189. padding-right: 40px;
  190. }
  191. .dropdown-menu li a {
  192. text-decoration: none;
  193. padding-left: 15px;
  194. font-weight: 400;
  195. color: #000;
  196. }
  197. .dropdown-menu {
  198. --bs-dropdown-padding-y: 0;
  199. }
  200. @media (min-width: 768px) {
  201. body {
  202. margin-top: 40px;
  203. /*130px;*/
  204. }
  205. .navbar-collapse {
  206. float: left;
  207. width: 100%;
  208. clear: both;
  209. }
  210. .navbar-inverse {
  211. border-top: 50px solid pink;
  212. }
  213. /* .navbar-nav:nth-child(2) {
  214. margin-top: 20px;
  215. clear: both;
  216. }
  217. .navbar-nav:nth-child(1) {
  218. margin-top: -20px;
  219. clear: both;
  220. } */
  221. }
  222. .second-nav {
  223. margin-top: 40px;
  224. }
  225. li#search.nav-item {
  226. margin-left: 0;
  227. }
  228. .navbar {
  229. height: auto;
  230. }
  231. div.search-box.nav-link {
  232. margin-top: 30px;
  233. }
  234. nav ul,
  235. .dropdown-menu li a {
  236. font-size: 0.875rem;
  237. font-weight: 700;
  238. padding: var(--bs-dropdown-item-padding-y) var(--bs-dropdown-item-padding-x);
  239. display: block;
  240. }
  241. .text-red {
  242. color: #D6001C;
  243. }
  244. .text-ltred {
  245. color: #FF435C;
  246. }
  247. .text-white {
  248. color: #fff;
  249. }
  250. .dropend .dropdown-menu[data-bs-popper] {
  251. background-color: lightgrey;
  252. }
  253. @media (min-width: 576px) {
  254. .navbar {
  255. height: auto;
  256. }
  257. li#search.nav-item {
  258. margin-left: 0;
  259. }
  260. div.search-box.nav-link {
  261. margin-top: 30px;
  262. }
  263. .navbar-expand-md .navbar-nav .nav-link {
  264. margin-right: 0.2rem;
  265. margin-left: 0.2rem;
  266. padding-right: 0;
  267. padding-left: 0;
  268. }
  269. }
  270. @media (min-width: 768px) {
  271. .navbar {
  272. height: 40px;
  273. }
  274. .navbar-brand img {
  275. left: 50px;
  276. top: 0;
  277. width: 160px;
  278. }
  279. .menu-one {
  280. margin-top: 50px;
  281. }
  282. .menu-two {
  283. margin-top: 10px;
  284. }
  285. .menu-two li a.nav-link {
  286. color: black !important;
  287. }
  288. .navbar-collapse {
  289. padding-top: 0px;
  290. padding-left: 0px;
  291. padding-right: 0px;
  292. }
  293. div.search-box.nav-link {
  294. margin-top: 0;
  295. }
  296. nav ul,
  297. .dropdown-menu li a {
  298. font-size: 0.75rem;
  299. font-weight: 700;
  300. }
  301. li#search.nav-item {
  302. margin-left: -1rem;
  303. /**was -3**/
  304. }
  305. .navbar-expand-md .navbar-nav .nav-link {
  306. margin-right: 0.6rem;
  307. margin-left: 0.6rem;
  308. padding-right: 0;
  309. padding-left: 0;
  310. }
  311. .dropend .dropdown-menu[data-bs-popper] {
  312. background-color: #fff;
  313. }
  314. }
  315. @media (min-width: 992px) {
  316. nav ul,
  317. .dropdown-menu li a {
  318. font-size: 1rem;
  319. font-weight: 700;
  320. }
  321. .navbar-expand-md .navbar-nav .nav-link {
  322. margin-right: 1rem;
  323. margin-left: 1rem;
  324. padding-right: 0;
  325. padding-left: 0;
  326. }
  327. }
  328. .navbar-nav {
  329. --bs-nav-link-padding-x: 0;
  330. --bs-nav-link-padding-y: 0.5rem;
  331. --bs-nav-link-font-weight: ;
  332. --bs-nav-link-color: #fff;
  333. --bs-nav-link-hover-color: #fff;
  334. }
  335. .btn-bd-primary {
  336. --bs-btn-color: #fff !important;
  337. --bs-btn-bg: #D6001C;
  338. --bs-btn-border-color: #D6001C;
  339. --bs-btn-hover-color: #D6001C !important;
  340. --bs-btn-hover-bg: #2E3138;
  341. --bs-btn-hover-border-color: #2E3138;
  342. --bs-btn-focus-shadow-rgb: 49, 132, 253;
  343. --bs-btn-active-color: #fff;
  344. --bs-btn-active-bg: #D6001C;
  345. --bs-btn-active-border-color: #D6001C;
  346. --bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
  347. --bs-btn-disabled-color: #fff;
  348. --bs-btn-disabled-bg: #D6001C;
  349. --bs-btn-disabled-border-color: #D6001C;
  350. --bs-btn-border-radius: 1.5rem;
  351. }
  352. /**Start - Search box**/
  353. /* div */
  354. .search-box {
  355. position: relative;
  356. /*was absolute*/
  357. top: 50%;
  358. left: 50%;
  359. transform: translate(-50%, -50%);
  360. background: #F6F6F6;
  361. /* was #cd595a;*/
  362. height: 30px;
  363. /*was 40px*/
  364. border-radius: 50px;
  365. padding: 0;
  366. /*was 10px*/
  367. }
  368. /* input */
  369. .search-input {
  370. outline: none;
  371. border: none;
  372. background: none;
  373. width: 0;
  374. padding: 0;
  375. color: #2E3138;
  376. float: left;
  377. font-size: 14px;
  378. transition: .3s;
  379. line-height: 30px;
  380. }
  381. .search-input::placeholder {
  382. color: #dbc5b0;
  383. }
  384. /* icon */
  385. .search-btn {
  386. color: #fff;
  387. float: right;
  388. width: 30px;
  389. height: 30px;
  390. border-radius: 50px;
  391. background: #222223;
  392. /* was #cd595a;*/
  393. display: flex;
  394. justify-content: center;
  395. align-items: center;
  396. text-decoration: none;
  397. transition: .3s;
  398. }
  399. .search-input:focus,
  400. .search-input:not(:placeholder-shown) {
  401. width: 120px;
  402. /*was 240px*/
  403. padding: 0 6px;
  404. }
  405. .search-box:hover &gt; .search-input {
  406. width: 120px;
  407. padding: 0 6px;
  408. }
  409. .search-box:hover &gt; .search-btn,
  410. .search-input:focus + .search-btn,
  411. .search-input:not(:placeholder-shown) + .search-btn {
  412. background: #222223;
  413. color: #fff;
  414. }
  415. /**End - Search box**/
  416. /**/
  417. .dropdown-menu li {
  418. position: relative;
  419. }
  420. .dropdown-menu .dropdown-submenu {
  421. display: none;
  422. position: absolute;
  423. left: 100%;
  424. top: -7px;
  425. }
  426. .dropdown-menu .dropdown-submenu-left {
  427. right: 100%;
  428. left: auto;
  429. }
  430. .dropdown-menu &gt; li:hover &gt; .dropdown-submenu {
  431. display: block;
  432. }
  433. /**/
  434. /*megamenu*/
  435. .navbar .megamenu {
  436. padding: 1rem;
  437. }
  438. .navbar .megamenu {
  439. margin-top: 0px;
  440. }
  441. /* ============ desktop view ============ was 992px */
  442. @media all and (min-width: 767px) {
  443. .navbar .has-megamenu {
  444. position: static !important;
  445. }
  446. .navbar .megamenu {
  447. left: 0;
  448. right: 0;
  449. width: 100%;
  450. margin-top: 70px;
  451. }
  452. }
  453. &lt;!-- language: lang-html --&gt;
  454. &lt;link href=&quot;https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css&quot; rel=&quot;stylesheet&quot; integrity=&quot;sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC&quot; crossorigin=&quot;anonymous&quot;&gt;
  455. &lt;script src=&quot;https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js&quot; integrity=&quot;sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM&quot; crossorigin=&quot;anonymous&quot;&gt;&lt;/script&gt;
  456. &lt;style&gt;
  457. html {
  458. overflow-x: hidden;
  459. }
  460. body {
  461. padding-right: 0 !important;
  462. font-family: &quot;Cera-PRO-Regular&quot;, Arial, sans-serif;
  463. font-weight: 300 !important;
  464. font-size: 1rem;
  465. line-height: 1.6;
  466. overflow-x: hidden;
  467. margin-top: 70px;
  468. }
  469. .navbar-collapse.in {
  470. max-height: 100%;
  471. }
  472. .no-border {
  473. border: none;
  474. }
  475. .menu-two li a.nav-link {
  476. color: white !important;
  477. }
  478. .navbar-collapse {
  479. padding-top: 70px;
  480. padding-left: 40px;
  481. padding-right: 40px;
  482. }
  483. .dropdown-menu li a {
  484. text-decoration: none;
  485. padding-left: 15px;
  486. font-weight: 400;
  487. color: #000;
  488. }
  489. .dropdown-menu {
  490. --bs-dropdown-padding-y: 0;
  491. }
  492. @media (min-width: 768px) {
  493. body {
  494. margin-top: 40px;
  495. /*130px;*/
  496. }
  497. .navbar-collapse {
  498. float: left;
  499. width: 100%;
  500. clear: both;
  501. }
  502. .navbar-inverse {
  503. border-top: 50px solid pink;
  504. }
  505. /* .navbar-nav:nth-child(2) {
  506. margin-top: 20px;
  507. clear: both;
  508. }
  509. .navbar-nav:nth-child(1) {
  510. margin-top: -20px;
  511. clear: both;
  512. } */
  513. }
  514. .second-nav {
  515. margin-top: 40px;
  516. }
  517. li#search.nav-item {
  518. margin-left: 0;
  519. }
  520. .navbar {
  521. height: auto;
  522. }
  523. div.search-box.nav-link {
  524. margin-top: 30px;
  525. }
  526. nav ul,
  527. .dropdown-menu li a {
  528. font-size: 0.875rem;
  529. font-weight: 700;
  530. padding: var(--bs-dropdown-item-padding-y) var(--bs-dropdown-item-padding-x);
  531. display: block;
  532. }
  533. .text-red {
  534. color: #D6001C;
  535. }
  536. .text-ltred {
  537. color: #FF435C;
  538. }
  539. .text-white {
  540. color: #fff;
  541. }
  542. .dropend .dropdown-menu[data-bs-popper] {
  543. background-color: lightgrey;
  544. }
  545. @media (min-width: 576px) {
  546. .navbar {
  547. height: auto;
  548. }
  549. li#search.nav-item {
  550. margin-left: 0;
  551. }
  552. div.search-box.nav-link {
  553. margin-top: 30px;
  554. }
  555. .navbar-expand-md .navbar-nav .nav-link {
  556. margin-right: 0.2rem;
  557. margin-left: 0.2rem;
  558. padding-right: 0;
  559. padding-left: 0;
  560. }
  561. }
  562. @media (min-width: 768px) {
  563. .navbar {
  564. height: 40px;
  565. }
  566. .navbar-brand img {
  567. left: 50px;
  568. top: 0;
  569. width: 160px;
  570. }
  571. .menu-one {
  572. margin-top: 50px;
  573. }
  574. .menu-two {
  575. margin-top: 10px;
  576. }
  577. .menu-two li a.nav-link {
  578. color: black !important;
  579. }
  580. .navbar-collapse {
  581. padding-top: 0px;
  582. padding-left: 0px;
  583. padding-right: 0px;
  584. }
  585. div.search-box.nav-link {
  586. margin-top: 0;
  587. }
  588. nav ul,
  589. .dropdown-menu li a {
  590. font-size: 0.75rem;
  591. font-weight: 700;
  592. }
  593. li#search.nav-item {
  594. margin-left: -1rem;
  595. /**was -3**/
  596. }
  597. .navbar-expand-md .navbar-nav .nav-link {
  598. margin-right: 0.6rem;
  599. margin-left: 0.6rem;
  600. padding-right: 0;
  601. padding-left: 0;
  602. }
  603. .dropend .dropdown-menu[data-bs-popper] {
  604. background-color: #fff;
  605. }
  606. }
  607. @media (min-width: 992px) {
  608. nav ul,
  609. .dropdown-menu li a {
  610. font-size: 1rem;
  611. font-weight: 700;
  612. }
  613. .navbar-expand-md .navbar-nav .nav-link {
  614. margin-right: 1rem;
  615. margin-left: 1rem;
  616. padding-right: 0;
  617. padding-left: 0;
  618. }
  619. }
  620. .navbar-nav {
  621. --bs-nav-link-padding-x: 0;
  622. --bs-nav-link-padding-y: 0.5rem;
  623. --bs-nav-link-font-weight: ;
  624. --bs-nav-link-color: #fff;
  625. --bs-nav-link-hover-color: #fff;
  626. }
  627. .btn-bd-primary {
  628. --bs-btn-color: #fff !important;
  629. --bs-btn-bg: #D6001C;
  630. --bs-btn-border-color: #D6001C;
  631. --bs-btn-hover-color: #D6001C !important;
  632. --bs-btn-hover-bg: #2E3138;
  633. --bs-btn-hover-border-color: #2E3138;
  634. --bs-btn-focus-shadow-rgb: 49, 132, 253;
  635. --bs-btn-active-color: #fff;
  636. --bs-btn-active-bg: #D6001C;
  637. --bs-btn-active-border-color: #D6001C;
  638. --bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
  639. --bs-btn-disabled-color: #fff;
  640. --bs-btn-disabled-bg: #D6001C;
  641. --bs-btn-disabled-border-color: #D6001C;
  642. --bs-btn-border-radius: 1.5rem;
  643. }
  644. /**Start - Search box**/
  645. /* div */
  646. .search-box {
  647. position: relative;
  648. /*was absolute*/
  649. top: 50%;
  650. left: 50%;
  651. transform: translate(-50%, -50%);
  652. background: #F6F6F6;
  653. /* was #cd595a;*/
  654. height: 30px;
  655. /*was 40px*/
  656. border-radius: 50px;
  657. padding: 0;
  658. /*was 10px*/
  659. }
  660. /* input */
  661. .search-input {
  662. outline: none;
  663. border: none;
  664. background: none;
  665. width: 0;
  666. padding: 0;
  667. color: #2E3138;
  668. float: left;
  669. font-size: 14px;
  670. transition: .3s;
  671. line-height: 30px;
  672. }
  673. .search-input::placeholder {
  674. color: #dbc5b0;
  675. }
  676. /* icon */
  677. .search-btn {
  678. color: #fff;
  679. float: right;
  680. width: 30px;
  681. height: 30px;
  682. border-radius: 50px;
  683. background: #222223;
  684. /* was #cd595a;*/
  685. display: flex;
  686. justify-content: center;
  687. align-items: center;
  688. text-decoration: none;
  689. transition: .3s;
  690. }
  691. .search-input:focus,
  692. .search-input:not(:placeholder-shown) {
  693. width: 120px;
  694. /*was 240px*/
  695. padding: 0 6px;
  696. }
  697. .search-box:hover &gt; .search-input {
  698. width: 120px;
  699. padding: 0 6px;
  700. }
  701. .search-box:hover &gt; .search-btn,
  702. .search-input:focus + .search-btn,
  703. .search-input:not(:placeholder-shown) + .search-btn {
  704. background: #222223;
  705. color: #fff;
  706. }
  707. /**End - Search box**/
  708. /**/
  709. .dropdown-menu li {
  710. position: relative;
  711. }
  712. .dropdown-menu .dropdown-submenu {
  713. display: none;
  714. position: absolute;
  715. left: 100%;
  716. top: -7px;
  717. }
  718. .dropdown-menu .dropdown-submenu-left {
  719. right: 100%;
  720. left: auto;
  721. }
  722. .dropdown-menu &gt; li:hover &gt; .dropdown-submenu {
  723. display: block;
  724. }
  725. /**/
  726. /*megamenu*/
  727. .navbar .megamenu {
  728. padding: 1rem;
  729. }
  730. .navbar .megamenu {
  731. margin-top: 0px;
  732. }
  733. /* ============ desktop view ============ was 992px */
  734. @media all and (min-width: 767px) {
  735. .navbar .has-megamenu {
  736. position: static !important;
  737. }
  738. .navbar .megamenu {
  739. left: 0;
  740. right: 0;
  741. width: 100%;
  742. margin-top: 70px;
  743. }
  744. }
  745. &lt;/style&gt;
  746. &lt;nav class=&quot;navbar navbar-expand-md navbar-dark fixed-top bg-dark&quot;&gt;
  747. &lt;div class=&quot;container-fluid&quot;&gt; &lt;a class=&quot;navbar-brand&quot; href=&quot;#&quot;&gt; LOGO &lt;/a&gt;
  748. &lt;button class=&quot;navbar-toggler&quot; type=&quot;button&quot; data-bs-toggle=&quot;collapse&quot; data-bs-target=&quot;#navbarCollapse&quot; aria-controls=&quot;navbarCollapse&quot; aria-expanded=&quot;false&quot; aria-label=&quot;Toggle navigation&quot;&gt; &lt;span class=&quot;navbar-toggler-icon&quot;&gt;&lt;/span&gt; &lt;/button&gt;
  749. &lt;!-- start test --&gt;
  750. &lt;div class=&quot;row navbar-collapse&quot; id=&quot;navbarCollapse&quot;&gt;
  751. &lt;div class=&quot;col-md-12 order-last menu-one&quot;&gt;
  752. &lt;!-- start--&gt;
  753. &lt;ul class=&quot;navbar-nav ms-auto mb-2 mb-md-0 nav navbar-right justify-content-end&quot;&gt;
  754. &lt;hr class=&quot;white d-block d-md-none&quot;&gt;
  755. &lt;li class=&quot;nav-item&quot;&gt; &lt;a class=&quot;nav-link active&quot; aria-current=&quot;page&quot; href=&quot;#&quot;&gt;login &lt;/a&gt; &lt;/li&gt;
  756. &lt;li class=&quot;nav-item&quot;&gt; &lt;a class=&quot;nav-link&quot; href=&quot;#&quot;&gt;support &lt;span class=&quot;text-ltred&quot;&gt;1300 000 123&lt;/span&gt;&lt;/a&gt; &lt;/li&gt;
  757. &lt;li class=&quot;nav-item dropdown&quot;&gt; &lt;a class=&quot;nav-link dropdown-toggle&quot; href=&quot;#&quot; role=&quot;button&quot; data-bs-toggle=&quot;dropdown&quot; aria-expanded=&quot;false&quot;&gt; Global sites &lt;/a&gt;
  758. &lt;ul class=&quot;dropdown-menu dropdown-menu-end&quot;&gt;
  759. &lt;li&gt;&lt;a class=&quot;dropdown-item&quot; href=&quot;#&quot;&gt;United States / Canada&lt;/a&gt;&lt;/li&gt;
  760. &lt;li&gt;&lt;a class=&quot;dropdown-item&quot; href=&quot;#&quot;&gt;New Zealand&lt;/a&gt;&lt;/li&gt;
  761. &lt;/ul&gt;
  762. &lt;/li&gt;
  763. &lt;li class=&quot;nav-item&quot; id=&quot;search&quot;&gt;
  764. &lt;div class=&quot;search-box nav-link&quot;&gt;
  765. &lt;input type=&quot;text&quot; class=&quot;search-input&quot; placeholder=&quot;Search&quot;&gt;
  766. &lt;a class=&quot;search-btn&quot; href=&quot;#&quot;&gt; ? &lt;/a&gt; &lt;/div&gt;
  767. &lt;/li&gt;
  768. &lt;/ul&gt;
  769. &lt;!-- end --&gt;
  770. &lt;/div&gt;
  771. &lt;div class=&quot;col-md-12 order-md-last menu-two&quot;&gt;
  772. &lt;!-- start--&gt;
  773. &lt;ul class=&quot;navbar-nav ms-auto mb-2 mb-md-0 nav navbar-right justify-content-end&quot;&gt;
  774. &lt;li class=&quot;nav-item dropdown has-megamenu&quot;&gt; &lt;a class=&quot;nav-link dropdown-toggle&quot; href=&quot;#&quot; data-bs-toggle=&quot;dropdown&quot;&gt;Solutions &amp;amp; services&lt;/a&gt;
  775. &lt;div class=&quot;dropdown-menu megamenu&quot; role=&quot;menu&quot;&gt;
  776. &lt;div class=&quot;row g-3&quot;&gt;
  777. &lt;div class=&quot;col-md-6 col-12&quot;&gt;
  778. &lt;div class=&quot;col-megamenu&quot;&gt;
  779. &lt;h6 class=&quot;title&quot;&gt;Solutions &amp;amp; services&lt;/h6&gt;
  780. &lt;ul class=&quot;list-unstyled&quot;&gt;
  781. &lt;li class=&quot;dropend&quot;&gt; &lt;a href=&quot;#&quot; class=&quot;dropdown-item dropdown-toggle&quot; data-bs-toggle=&quot;dropdown&quot; aria-haspopup=&quot;true&quot; data-bs-auto-close=&quot;true&quot; aria-expanded=&quot;false&quot;&gt;Leasing solutions&lt;/a&gt;
  782. &lt;ul class=&quot;dropdown-menu no-border&quot;&gt;
  783. &lt;li&gt;&lt;a class=&quot;dropdown-item&quot; href=&quot;&quot;&gt; Transfer my fleet&lt;/a&gt;&lt;/li&gt;
  784. &lt;li&gt;&lt;a class=&quot;dropdown-item&quot; href=&quot;&quot;&gt; Start a new fleet&lt;/a&gt;&lt;/li&gt;
  785. &lt;li&gt;&lt;a class=&quot;dropdown-item&quot; href=&quot;&quot;&gt; Electric vehicles&lt;/a&gt;&lt;/li&gt;
  786. &lt;li&gt;&lt;a class=&quot;dropdown-item&quot; href=&quot;&quot;&gt; Next lease&lt;/a&gt;&lt;/li&gt;
  787. &lt;li&gt;&lt;a class=&quot;dropdown-item&quot; href=&quot;&quot;&gt; Trucks, plant &amp;amp; equipment&lt;/a&gt;&lt;/li&gt;
  788. &lt;li&gt;&lt;a class=&quot;dropdown-item&quot; href=&quot;&quot;&gt; Used vehicles&lt;/a&gt;&lt;/li&gt;
  789. &lt;/ul&gt;
  790. &lt;/li&gt;
  791. &lt;li class=&quot;dropend&quot;&gt; &lt;a href=&quot;#&quot; class=&quot;dropdown-item dropdown-toggle&quot; data-bs-toggle=&quot;dropdown&quot; aria-haspopup=&quot;true&quot; data-bs-auto-close=&quot;true&quot; aria-expanded=&quot;false&quot;&gt;Fleet management services&lt;/a&gt;
  792. &lt;ul class=&quot;dropdown-menu no-border&quot;&gt;
  793. &lt;li&gt;&lt;a class=&quot;dropdown-item&quot; href=&quot;&quot;&gt; Accident management&lt;/a&gt;&lt;/li&gt;
  794. &lt;li&gt;&lt;a class=&quot;dropdown-item&quot; href=&quot;&quot;&gt; Acquisition and disposals&lt;/a&gt;&lt;/li&gt;
  795. &lt;li&gt;&lt;a class=&quot;dropdown-item&quot; href=&quot;&quot;&gt; Driver safety&lt;/a&gt;&lt;/li&gt;
  796. &lt;li&gt;&lt;a class=&quot;dropdown-item&quot; href=&quot;&quot;&gt; Fleet card&lt;/a&gt;&lt;/li&gt;
  797. &lt;li&gt;&lt;a class=&quot;dropdown-item&quot; href=&quot;&quot;&gt; Hire vehicles&lt;/a&gt;&lt;/li&gt;
  798. &lt;li&gt;&lt;a class=&quot;dropdown-item&quot; href=&quot;&quot;&gt; Infringement management&lt;/a&gt;&lt;/li&gt;
  799. &lt;li&gt;&lt;a class=&quot;dropdown-item&quot; href=&quot;&quot;&gt; Insurance&lt;/a&gt;&lt;/li&gt;
  800. &lt;li&gt;&lt;a class=&quot;dropdown-item&quot; href=&quot;&quot;&gt; Maintenance&lt;/a&gt;&lt;/li&gt;
  801. &lt;li&gt;&lt;a class=&quot;dropdown-item&quot; href=&quot;&quot;&gt; PoolCar sharing platform&lt;/a&gt;&lt;/li&gt;
  802. &lt;li&gt;&lt;a class=&quot;dropdown-item&quot; href=&quot;&quot;&gt; Registration&lt;/a&gt;&lt;/li&gt;
  803. &lt;li&gt;&lt;a class=&quot;dropdown-item&quot; href=&quot;&quot;&gt; Roadside assistance&lt;/a&gt;&lt;/li&gt;
  804. &lt;li&gt;&lt;a class=&quot;dropdown-item&quot; href=&quot;&quot;&gt; Telematics&lt;/a&gt;&lt;/li&gt;
  805. &lt;li&gt;&lt;a class=&quot;dropdown-item&quot; href=&quot;&quot;&gt; Toll management&lt;/a&gt;&lt;/li&gt;
  806. &lt;/ul&gt;
  807. &lt;/li&gt;
  808. &lt;li class=&quot;dropend&quot;&gt; &lt;a href=&quot;#&quot; class=&quot;dropdown-item dropdown-toggle&quot; data-bs-toggle=&quot;dropdown&quot; aria-haspopup=&quot;true&quot; data-bs-auto-close=&quot;true&quot; aria-expanded=&quot;false&quot;&gt;Fleet optimisation&lt;/a&gt;
  809. &lt;ul class=&quot;dropdown-menu no-border&quot;&gt;
  810. &lt;li&gt;&lt;a class=&quot;dropdown-item&quot; href=&quot;&quot;&gt; Corporate financing&lt;/a&gt;&lt;/li&gt;
  811. &lt;li&gt;&lt;a class=&quot;dropdown-item&quot; href=&quot;&quot;&gt; Leasing&lt;/a&gt;&lt;/li&gt;
  812. &lt;li&gt;&lt;a class=&quot;dropdown-item&quot; href=&quot;&quot;&gt; Sales and lease back&lt;/a&gt;&lt;/li&gt;
  813. &lt;li&gt;&lt;a class=&quot;dropdown-item&quot; href=&quot;&quot;&gt; Strategic consulting&lt;/a&gt;&lt;/li&gt;
  814. &lt;li&gt;&lt;a class=&quot;dropdown-item&quot; href=&quot;&quot;&gt; Technology integration&lt;/a&gt;&lt;/li&gt;
  815. &lt;/ul&gt;
  816. &lt;/li&gt;
  817. &lt;/ul&gt;
  818. &lt;/div&gt;
  819. &lt;!-- col-megamenu.// --&gt;
  820. &lt;/div&gt;
  821. &lt;!-- end col-3 --&gt;
  822. &lt;/div&gt;
  823. &lt;!-- end row --&gt;
  824. &lt;/div&gt;
  825. &lt;!-- dropdown-mega-menu.// --&gt;
  826. &lt;/li&gt;
  827. &lt;li class=&quot;nav-item&quot;&gt; &lt;a class=&quot;nav-link&quot; href=&quot;#&quot;&gt;Driver Support&lt;/a&gt;&lt;/li&gt;
  828. &lt;li class=&quot;nav-item&quot;&gt; &lt;a class=&quot;nav-link&quot; href=&quot;#&quot;&gt;About&lt;/a&gt;&lt;/li&gt;
  829. &lt;li class=&quot;nav-item&quot;&gt; &lt;a class=&quot;nav-link&quot; href=&quot;#&quot;&gt;News&lt;/a&gt;&lt;/li&gt;
  830. &lt;li class=&quot;nav-item&quot;&gt; &lt;a class=&quot;nav-link&quot; href=&quot;#&quot;&gt;Resources&lt;/a&gt;&lt;/li&gt;
  831. &lt;li class=&quot;nav-item&quot;&gt; &lt;a class=&quot;btn btn-bd-primary&quot; href=&quot;#&quot; role=&quot;button&quot;&gt;Contact us&lt;/a&gt;&lt;/li&gt;
  832. &lt;/ul&gt;
  833. &lt;!-- end --&gt;
  834. &lt;/div&gt;
  835. &lt;/div&gt;
  836. &lt;!-- end test --&gt;
  837. &lt;/div&gt;
  838. &lt;/nav&gt;
  839. &lt;!-- end snippet --&gt;
  840. </details>

huangapple
  • 本文由 发表于 2023年4月13日 18:31:50
  • 转载请务必保留本文链接:https://go.coder-hub.com/76004404.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定