-1

hope you are all doing well, i have just face a problem. i make my website online. everything working well expect navbar toggler icon. it is not working on mobile device. it is working well on desktop here is my code

<nav class="navbar navbar-expand-md navbar-light bg-light sticky-top">
        <div class="container-fluid">
            <a class="navbar-brand" href="index.php"><img src="./assests/images/logo.png" class="logo ml-5" alt="file not found" /> </a>
        <button class="navbar-toggler " type="button" role="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation"> 
            <span class="navbar-toggler-icon"> </span>
        </button>   
        <div class="collapse navbar-collapse" id="navbarResponsive">
                <ul class="navbar-nav ml-auto">
                    <li class="nav-item <?php if($page == 'home') echo 'active' ?>">
                        <a class="nav-link " href="index.php"><i class="mr-2 fas fa-home"> </i>Home </a>
                    </li>
                    <li class="nav-item <?php if($page == 'about') echo 'active' ?>">
                        <a class="nav-link" href="about.php"><i class="mr-2 fas fa-users"> </i>     About Us</a>
                    </li>
                    <li class="nav-item  dropdown  <?php if($page == 'products') echo 'active' ?>" >
                        <a class="nav-link dropdown-toggle dropdown-toggle-split" href="products.php" data-toggle="dropdown" id="dropedownMenuButton"aria-expanded="false" aria-hospopup="true" >
                            <i class="mr-2 fas fa-wrench"> </i>Products 
                        </a>
                        <ul class="dropdown-menu" aria-labelledby="dropedownMenuButton">
                            <li class="list-group-item">
                                <a class="dropdown-item" href="bolts-screws.php"> Bolts/Screws </a>
                             </li>
                             <li class="list-group-item">
                                <a class="dropdown-item" href="nuts.php"> Nuts </a>
                             </li>
                             <li class="list-group-item">
                                <a class="dropdown-item" href="washers.php"> Washers </a>
                             </li>
                             <li class="list-group-item">
                                <a class="dropdown-item" href="screws.php"> Screws </a>
                             </li>
                             <li class="list-group-item">
                                <a class="dropdown-item" href="socket-bolt-screws.php"> Socket Bolts/Screws </a>
                             </li>
                             <li class="list-group-item">
                                <a class="dropdown-item" href="anchor-fastener.php"> Anchor Fasteners </a>
                             </li>
                        </ul>
                    </li>
                    <li class="nav-item <?php if($page == 'connect') echo 'active' ?>">
                        <a class="nav-link" href="connect.php"><i class="mr-2 fas fa-user"> </i> Contact us </a>
                    </li>
                </ul>
            </div>
        </div>
    </nav>

you can check my website also http://rudrafasteners.com/

  • 1
    For me at least, your bootstrap javascript script is not properly included. It uses the localhost. No, javascript no toggling. Perhaps it works for you? – KIKO Software Dec 15 '20 at 13:49
  • Does this answer your question? [Bootstrap Dropdown menu is not working](https://stackoverflow.com/questions/22383547/bootstrap-dropdown-menu-is-not-working) – Pablo Cordero Dec 15 '20 at 13:50
  • kiko software thanks a lot you are right i was still using localhost – Sudhir kumar Dec 15 '20 at 14:13

1 Answers1

1

It seems you don't add Javascript at your head. Add the followings lines to your HTML <head> tag (Jquery and Bootstrap JS):

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
Pablo Cordero
  • 143
  • 1
  • 10