我在我的网站上使用bootstrap切换按钮在计算机浏览器上工作但不能在移动浏览器上工作
这是代码:
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/styles.css">
<link rel="stylesheet" href="css/bootstrap-multiselect.css">
<link href="css/bootstrap-select.min.css" rel="stylesheet" />
<link href="https://code.jquery.com/ui/1.12.0/themes/smoothness/jquery-ui.css" rel="stylesheet"/>
<link rel="stylesheet" href="https://rawgit.com/trentrichardson/jQuery-Timepicker-Addon/master/dist/jquery-ui-timepicker-addon.min.css">
<link href="css/lightbox.css" rel="stylesheet" />
<link rel="shortcut icon" type="image/x-icon" href="img/favicon.ico" />
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar4">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="main.php"><img src="img/t-square-logo-Final.png" alt="T-square" class="tslogo"/></a>
</div>
<div id="navbar4" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li class="active"><a href="main.php">Home</a></li>
<li><a href="dms.php">DMS</a></li>
<li><a href="main.php?action=backup">Backup</a></li>
<li><a href="logout.php">LogOut</a></li>
</ul>
</div>
</div>
</nav>
<link rel="stylesheet" href="css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
我尝试像here那样做 但我仍然有同样的问题
任何人都可以帮助解决我的问题吗?
答案 0 :(得分:4)
将其添加到标题
<meta name="viewport" content="width=device-width, initial-scale=1">
答案 1 :(得分:1)
您的脚本:未加载bootstrap.min.js。当我在项目中删除此文件时,切换按钮停止工作。
您能否验证文件是否正确加载?