bootstrap navbar toggle not collapsing

时间:2015-08-08 12:28:05

标签: twitter-bootstrap

这是我的代码。请告诉我代码中的错误在哪里:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html
xmlns="http://www.w3.org/1999/xhtml"> <head> <meta
http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Marbles & Marbles</title> <link rel="stylesheet"
type="text/css" href="bootstrap/css/bootstrap.min.css"/> <script
type="text/javascript" src="bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="jquery/jquery-2.1.4.js"></script>
<script src="bxslider-4-master/dist/jquery.bxslider.min.js"></script>
<link rel="stylesheet" type="text/css" href="slider/engine1/style.css"
/> </head> <body> <nav class="navbar navbar-inverse">   <div
class="container">
    <!-- Brand and toggle get grouped for better mobile display -->
     <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"
aria-expanded="false">
        <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="#">Marbles & Marbles</a>
    </div>

     <!-- Collect the nav links, forms, and other content for toggling -->
     <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
       <ul class="nav navbar-nav">
         <li class="active"><a href="#">Home</a></li>
         <li><a href="#">About Us</a></li>
          <li><a href="#">Contact Us</a></li>
         </ul>
         </div>
         </div>
        </nav>
       </body> </html>

1 个答案:

答案 0 :(得分:1)

jQuery需要引导Bootstrap JS文件:

更改此顺序:

    public void test() {

            Session session = HibernateUtil.currentSession();
            session.beginTransaction();

            Vehicle  vehicle= (Vehicle) session.get(Vehicle.class, 2);

            System.out.println(vehicle.getVehicleName());

            session.getTransaction().commit();
            session.close();
            System.out.println(vehicle.getVehicleName()); //No exception here
            System.out.println(vehicle.getUser().getUserName()); 
// Exception here change the loading to EAGER or put this line of code within the session above. Put it before session.close() or  before session.getTransaction().commit();
        }

这个脚本的订单:

<script type="text/javascript" src="bootstrap/js/bootstrap.min.js"></script>

<script type="text/javascript" src="jquery/jquery-2.1.4.js"></script>