Topic: navbar links collapsed and vertically aligned by default

Jonathan Washington pro asked 7 years ago


I am using the free version of MDB to develop a wordpress theme. When I use the code from the navbar documentation the links are collapsed by default and when the toggler is clicked the nav links are vertically aligned instead of displayed horizontally as it was in MDB 3. If anyone knows why this is happening please share. Thanks!  
<nav class="navbar navbar-expand-lg navbar-dark indigo">

<!-- Navbar brand -->
 <a class="navbar-brand" href="#">Navbar</a>

<!-- Collapse button -->
 <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent"
 aria-expanded="false" aria-label="Toggle navigation"><span class="navbar-toggler-icon"></span></button>

<!-- Collapsible content -->
 <div class="collapse navbar-collapse" id="navbarSupportedContent">

<!-- Links -->
 <ul class="navbar-nav mr-auto">
 <li class="nav-item active">
 <a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
 </li>
 <li class="nav-item">
 <a class="nav-link" href="#">Features</a>
 </li>
 <li class="nav-item">
 <a class="nav-link" href="#">Pricing</a>
 </li>

<!-- Dropdown -->
 <li class="nav-item dropdown">
 <a class="nav-link dropdown-toggle" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Dropdown</a>
 <div class="dropdown-menu dropdown-primary" aria-labelledby="navbarDropdownMenuLink">
 <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>
 </li>

</ul>
 <!-- Links -->

<!-- Search form -->
 <form class="form-inline">
 <input class="form-control mr-sm-2" type="text" placeholder="Search" aria-label="Search">
 </form>
 </div>
 <!-- Collapsible content -->

</nav>
 

 

navproblem2
                
                  

Marta Wierzbicka staff answered 7 years ago


Hi, could you tell me what is the exact version of MDB you have? You can find this in README.txt file. And tell as many details about your MDB files and code as you can, I'll try to help. Best, Marta

Jonathan Washington pro commented 7 years ago

I found the solution! I forgot to update the jquery version in functions.php. Thanks for your help! Running 4.4.1 btw

Marta Wierzbicka staff answered 7 years ago


Hi, I'm glad you found the solution. Best, Marta

Sefa Can Demir free answered 7 years ago


i have same problem

Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Pro
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: Yes
  • Provided link: Yes
Tags