在代码中,我同时使用了 Bootstrap Material Design 和 Bootstrap CDN。在抽屉中如果我尝试打开类别下拉菜单意味着它只是在闪烁。我也尝试在其他方面做。就像在容器中一样。但也有同样的闪烁错误。
我从 Bootstrap 官方网站以及 Material bootstrap 复制了两者我也尝试过,但“类别下拉菜单显示相同”
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1, width=device-width, viewport-fit=cover">
<link rel="stylesheet" type="text/css" href="css/index.css">
<link rel="icon" href="img/logo.png">
<link rel="stylesheet" href="https://unpkg.com/bootstrap-material-design@4.1.1/dist/css/bootstrap-material-design.min.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Material+Icons">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
<style>
</style>
<title>aabbaaaa</title>
</head>
<body>
<div>
<div class="bmd-layout-container bmd-drawer-f-l bmd-drawer-overlay" id="d1">
<header class="bmd-layout-header">
<div class="navbar navbar-light bg-faded">
<button class="navbar-toggler" type="button" data-toggle="drawer" data-target="#dw-s2">
<span class="sr-only">Toggle drawer</span>
<i class="material-icons">menu</i>
</button>
<a href="index.html" class="navbar-brand" style="padding-right: 30%;">aabbaaaa</a>
<i class="far fa-user-circle" style="padding:0;"></i></i>
<i class="fas fa-shopping-cart"><sup><span class="badge badge-info">0</span></sup></i>
</div>
</header>
<div id="dw-s2" class="bmd-layout-drawer bg-faded">
<header style="display: inline-block;">
<a href="index.html" style="text-decoration: none;"><i class="fas fa-home"></i>Home</a>
<a class="navbar-brand" href="index.html" style="padding-left: 50%;;"><img src="img/logo.png" class="img-fluid" style="height: 25px;width: 25px;"></a>
</header>
<ul class="list-group">
<li class="list-group-item">
<div class="dropdown show">
<a class="dropdown-toggle text-dark" href="#" role="link" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Categories
</a>
<div class="dropdown-menu" aria-labelledby="dropdownMenuLink">
<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>
</li>
<li class="list-group-item">Product</li>
<li class="list-group-item">Shopping Cart</li>
<li class="list-group-item">Checkout</li>
<li class="list-group-item">My Order</li>
<li class="list-group-item">My wishlist</li>
<li class="list-group-item">My account</li>
<li class="list-group-item">My notifications</li>
<li class="list-group-item">Help Center</li>
</ul>
</div>
<main class="bmd-layout-content">
<div class="bmd-form-group bmd-collapse-inline pull-xs-right">
<button class="btn bmd-btn-icon" for="search" data-toggle="collapse" data-target="#collapse-search" aria-expanded="false" aria-controls="collapse-search">
<i class="material-icons">search</i>
</button>
<span id="collapse-search" class="collapse">
<input class="form-control" type="text" id="search" placeholder="Enter your query...">
</span>
</div>
<div class="container">
<p>Main content</p>
<p>Lorem ipsum dolor sit amet consectetur, adipisicing elit. Nobis velit consequuntur error! Rem fugiat, quibusdam dolorum laborum quo reprehenderit non? Blanditiis dolorum rem nisi, quidem delectus explicabo aliquid ipsum sequi?</p>
<p>Lorem ipsum dolor sit amet consectetur, adipisicing elit. Nobis velit consequuntur error! Rem fugiat, quibusdam dolorum laborum quo reprehenderit non? Blanditiis dolorum rem nisi, quidem delectus explicabo aliquid ipsum sequi?</p>
<p>Lorem ipsum dolor sit amet consectetur, adipisicing elit. Nobis velit consequuntur error! Rem fugiat, quibusdam dolorum laborum quo reprehenderit non? Blanditiis dolorum rem nisi, quidem delectus explicabo aliquid ipsum sequi?</p>
<p>Lorem ipsum dolor sit amet consectetur, adipisicing elit. Nobis velit consequuntur error! Rem fugiat, quibusdam dolorum laborum quo reprehenderit non? Blanditiis dolorum rem nisi, quidem delectus explicabo aliquid ipsum sequi?</p>
</div>
</main>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"></script>
<script src="https://unpkg.com/popper.js@1.12.6/dist/umd/popper.js"></script>
<script src="https://unpkg.com/bootstrap-material-design@4.1.1/dist/js/bootstrap-material-design.js"></script>
<script>
$(document).ready(function() {
$('body').bootstrapMaterialDesign();
});
</script>
<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" src="js/index.js"></script>
<script src="https://kit.fontawesome.com/596df9a01c.js" crossorigin="anonymous"></script>
</body>
</html>