bootstrap 3.2中的下拉菜单

时间:2014-08-06 07:33:06

标签: twitter-bootstrap

atully我刚刚参加了自助训练。因为我采用了这里找到的相同模板

http://getbootstrap.com/examples/theme/

bootstrap 3.2.0版

在此模板中,我将导航栏按钮向右推,下拉菜单停止工作。一旦完成。再次,如果我改变代码它停止工作和永远不会工作。我正在做的只是改变

class=" nav navbar-nav nav" . to class=" nav navbar-nav navbar-right" 

我的代码

<!DOCTYPE html>
<html lang="en">
  <head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="../../favicon.ico">

<title>Admission Portal</title>

<!-- Bootstrap core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- Bootstrap theme -->
<link href="css/bootstrap-theme.min.css" rel="stylesheet">

<!-- Custom styles for this template -->
<link href="theme.css" rel="stylesheet">

 </head>

   <body role="document">

  <!-- Fixed navbar -->
    <div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
     <div class="container">
      <div class="navbar-header">
          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
        <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="#">Admission portal</a>
      </div>
       <div class="navbar-collapse collapse">
        <ul class="nav navbar-nav nav">
        <li class="active"><a href="#">Home</a></li>
        <li><a href="#about">About</a></li>
        <li><a href="#contact">Contact</a></li>
        <li class="dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <span class="caret"></span></a>
          <ul class="dropdown-menu" role="menu">
            <li><a href="#">Action</a></li>
            <li><a href="#">Another action</a></li>
            <li><a href="#">Something else here</a></li>
            <li class="divider"></li>
            <li class="dropdown-header">Nav header</li>
            <li><a href="#">Separated link</a></li>
            <li><a href="#">One more separated link</a></li>
          </ul>
           </li>
         </ul>
        </div><!--/.nav-collapse -->
      </div>
    </div>

2 个答案:

答案 0 :(得分:0)

好吧,最后我找到了自己的问题答案。首先,bootstrap基于java脚本,因此您需要包含所有java脚本文件。特别是jquery.min。所以我缺乏那个。如果你想要更多相同的信息

问题依赖于 Bootstrap dropdown menu not working (not dropping down when clicked)

答案 1 :(得分:0)

简单回答

                String selectedPath = getPath(selectedImageUri);

只需在代码中添加此行即可开始工作。 注意:在bootstrap.min.js行

之前添加此行