我一直遇到Bootstrap Nav Bar下拉的问题。我直接从w3schools获取代码,但是下拉不适合所有人。他们对我和我的一些朋友工作得很好,但对其他人来说根本不起作用。我一直在环顾四周,人们似乎都有自己的JavaScript或一些代码。这只是bootstrap的一个无法解决的问题吗?如果是这样,有没有办法检测用户是否遇到问题?这是我的代码:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Dropdown test</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<style>
.error {color: #FF0000;}
.SOP {color: #FF0000;font-weight:bold;}
.AOP {color: #0066ff;font-weight:bold;}
.HOP {color: #00ff00;font-weight:bold;}
.VOP {color: #eeee00;font-weight:bold;}
.member {color: #009933;}
</style>
</head>
<body>
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="main.php">Dropdown Test</a>
</div>
<div>
<ul class="nav navbar-nav">
<li><a href="main.php">Home</a></li>
<li><a href="memberslist.php">Members</a></li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown">Mail
<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="sendmail.php">Send Mail</a></li>
<li><a href="newmail.php">Read New Mail</a></li>
<li><a href="oldmail.php">Read Old Mail</a></li>
</ul>
</li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown">Profile
<span class="caret"></span></a>
<ul class="dropdown-menu">
<li class="disabled"><a href="settings.php">Invite Codes</a></li>
<li><a href="logout.php">Logout</a></li>
</ul>
</li>
<li class="disabled"><a href="settings.php">Settings</a></li>
</ul>
</div>
</div>
</nav>
<div class="jumbotron">
<h1>Test</h1>
</div>
<br><br>
<div class="container">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum commodo augue iaculis, dictum ante eget, consequat purus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Vestibulum malesuada risus at condimentum condimentum. Sed tempor, elit non sodales commodo, dui elit auctor odio, id sollicitudin nisi nulla et urna. Nullam id rhoncus magna, nec posuere tortor. Duis scelerisque, nunc vel commodo fermentum, urna nunc lobortis diam, nec aliquam sem mi id dui. Morbi vitae leo ac felis congue maximus a in risus. Curabitur vehicula ornare porta. Ut pretium posuere dolor, vel ullamcorper metus gravida vel. Sed commodo justo id tincidunt posuere. Praesent quis aliquam felis. Sed quam ante, vestibulum vitae turpis eleifend, bibendum pretium arcu. Quisque vitae congue tellus, id molestie mi. </p>
</div>
</body>
</html>