我試圖創建一個簡單的頁面,當我在一個標籤項單擊應該讓屏幕上消失了該網頁。在這個簡單的代碼中,當我點擊關於應該讓產品下拉菜單消失。這裏是代碼隱藏和點擊標籤項創建另一個對象 - HTML CSS
<!DOCTYPE html>
<html lang="en">
<head>
<title>Drop Down Navbar</title>
<link rel="stylesheet" type="text/css" href="css/bootstrap.css"/>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script src="js/bootstrap.js"></script>
</head>
<body>
<div class="container">
<div class="row">
<div class="span12">
<h3>Bootstrap Dropdown Menu By Creativity-Tuts</h3>
<div class="navbar">
<div class="navbar-inner">
<ul class="nav">
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
</ul>
</div>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#"> Products <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#">Prod 1</a></li>
<li><a href="#">Prod 2</a></li>
<li><a href="#">Prod 3</a></li>
<li><a href="#">Prod 4</a></li>
</ul>
</li>
</div>
</div>
</div>
</div>
</body>
</html>
我打算使用onClick並調用一個函數來隱藏該下拉菜單嗎?這裏是的jsfiddle link
您可以發佈與CSS和JS整個代碼? –
http://jsbin.com/uQApiJ/2/月份作爲下拉菜單的whol容器應該會消失 – Siddharthan