我真的被困在這一點上。我有一個名爲「Example」的下拉菜單,其中包含2個子菜單「submenu1」和「submenu2」。當點擊其中任何一個時,它將包含將以燈箱樣式顯示的圖像縮略圖。但截至目前,這兩個拇指都顯示出來了,這不是我想要的,因爲最終的網頁將包含數百個圖像。根據下面的代碼,是否有一種方法可以使圖像僅在單擊一個子菜單時出現。由於點擊下拉菜單顯示div內容
<!DOCTYPE html>
<head>
</head>
<body>
<!-- Portfolio Projects -->
<div class="row">
<div class="span3">
<!-- Filter -->
<nav id="options" class="work-nav">
<ul id="filters" class="option-set" data-option-key="filter">
<li class="type-work">CATEGORIES</li>
<li class="dropdown"><a data-toggle="dropdown" class="dropdown-toggle"
>BAPTISM
<b class="caret"></b></a>
<ul class="dropdown-menu">
<li class="dropdown-submenu">
<a href="#" class="selected">BOY CLOTHING</a>
<ul class="dropdown-menu">
<li><a href="#filter" data-option-
value=".boy" tabindex="-1">Clothing</a></li>
</ul>
</li>
<li class="dropdown-submenu">
<a href="#">GIRL CLOTHING</a>
<ul class="dropdown-menu">
<li><a href="#filter" data-option-
value=".girl" tabindex="-1">Clothing</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</nav>
<script src="http://code.jquery.com/jquery.js"></script>
<script src="js/bootstrap.min.js"></script>
</ul>
</nav>
<!-- End Filter -->
</div>
<div class="span9">
<div class="row">
<section id="projects">
<ul id="thumbs">
<!-- gallery starts here -->
<li class="item-thumbs span3 boy"><!-- Fancybox - Gallery Enabled
- Title - Full Image -->
<a class="hover-wrap fancybox" data-fancybox-group="boy"
title="" href="_include/img/work/full/boy_clothing.jpg">
<span class="overlay-img"></span>
</a>
<!-- Thumb Image and Description -->
<img src="_include/img/work/thumbs/boy_clothing.jpg" alt="">
</li>
<li class="item-thumbs span3 girl">
<!-- Fancybox - Gallery Enabled - Title - Full Image -->
<a class="hover-wrap fancybox" data-fancybox-group="girl"
title="" href="_include/img/work/full/girl_clothing.jpg">
<span class="overlay-img"></span>
</a>
<!-- Thumb Image and Description -->
<img src="_include/img/work/thumbs/girl_clothing.jpg"
alt="">
</li>
</ul>
</section>
</div>
</div>
</div>
<!-- End Portfolio Projects -->
</body>
</html>
最終的結果也許你能告訴我們一些CSS – JuSchz
。 work-nav #filters { \t margin:0; \t padding:0; \t list-style:none; } .work-nav #filters li { \t padding:0; \t margin-bottom:10px; \t margin-left:0; \t margin-right:0; \t margin-top:0; } .work-nav #filters li a { \t color:#515151; \t font-size:16px; \t display:block; } 。work-nav #filters li a:hover { \t color:#5892A8; } .work-nav #filters li a.selected { \t color:#5892A8; } #thumbs { \t margin:0; \t padding:0; \t } – user2875913
#thumbs li { \t list-style-type:none; } .item-thumbs { \t position:relative; \t溢出:隱藏; \t margin-bottom:30px; \t光標:指針; } .item-thumbs a + img { \t width:100%; \t } – user2875913