0

I was trying to create a dropdown like code below, but it seems when I toggle the button, it won't drop it down. Any ideas? I've inserted the bootstrap library etc., but it doesn't work.

<div class="dropdown">
    <button class="btn btn-outline-success dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
        <a href="<?= base_url() ?>profile" class="profile"><?= $user['name']; ?></a>
        <img class="img-profile rounded-circle" src="<?= base_url() . "foto_ktp/" . $user['picture']; ?>" style="margin-top:-2px;width:30px;height:30px;">
    </button>
    <div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
        <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>
</div>

Here is the javascript that I inserted:

<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>

<script src="<?php echo base_url(); ?>assets/js/jquery-3.2.1.min.js"></script>
<script src="<?php echo base_url(); ?>assets/js/bootstrap.min.js"></script>
<script src="<?php echo base_url(); ?>assets/js/jquery.slicknav.min.js"></script>

<script src="<?php echo base_url(); ?>assets/js/sb-admin-2.js"></script>
<script src="<?php echo base_url(); ?>assets/js/sb-admin-2.min.js"></script>

<script src="<?php echo base_url(); ?>assets/js/owl.carousel.min.js"></script>
<script src="<?php echo base_url(); ?>assets/js/mixitup.min.js"></script>
<script src="<?php echo base_url(); ?>assets/js/main.js"></script>

And this is the style I inserted through linkrel:

<!-- Favicon -->
<link href="<?php echo base_url(); ?>assets/img/logoswi.png" rel="icon" />

<!-- Google font -->
<link href="https://fonts.googleapis.com/css?family=Montserrat:300,300i,400,400i,500,500i,600,600i,700,700i&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">

<!-- Stylesheets -->
<link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/bootstrap.min.css" />
<link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/sb-admin-2.css" />
<link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/sb-admin-2.min.css" />
<link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/font-awesome.min.css" />
<link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/owl.carousel.min.css" />
<link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/slicknav.min.css" />

<!-- Main Stylesheets -->
<link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/style.css" />
4

0 回答 0