0
我有三個級別的過濾的過濾器的菜單,我想設置這樣的:力的雙ONCLICK觸發器觸發事件僅一次
單擊選項從一個層次>二級滑出 單擊一個選項三滑出
我目前有的問題是,一個級別中的所有項目都是onClick事件的「觸發器」...並且更改級別選項會導致下一級菜單在我需要它退出的地方滑回去。
景觀在這裏:http://jsfiddle.net/RevConcept/JW5Mm/1/
這裏是我的代碼(注意,onClick事件僅用於級別之一,現在觸發二級設置)...
HTML
<div id="options" class="combo-filters">
<div class="option-combo location">
<ul class="filter option-set group " data-filter-group="location">
<li class="hidden"><a href="#filter-location-any" data-filter-value="" class="selected">any</a>
<li><a href="#filter-location-exterior" data-filter-value=".exterior" class="trigger">exterior</a>
<li><a href="#filter-location-interior" data-filter-value=".interior" class="trigger">interior</a>
</ul>
</div>
<div class="option-combo illumination">
<ul class="filter option-set group toggle" data-filter-group="illumination">
<li class="hidden"><a href="#filter-illumination-any" data-filter-value="" class="selected">any</a>
<li><a href="#filter-illumination-illuminated" data-filter-value=".illuminated">illuminated</a>
<li><a href="#filter-illumination-non-illuminated" data-filter-value=".non-illuminated">non-illuminated</a>
</ul>
</div>
<div class="option-combo mount">
<ul class="filter option-set group " data-filter-group="mount">
<li class="hidden"><a href="#filter-mount-any" data-filter-value="" class="selected">any</a>
<li><a href="#filter-mount-wall" data-filter-value=".wall">wall</a>
<li><a href="#filter-mount-ground" data-filter-value=".ground">ground</a>
</ul>
</div>
</div><!--end options-->
CSS
header nav ul.toggle {
display:none;
}
的JavaScript
$(".trigger").one('click', function(){
$(".toggle").slideToggle('fast');
});
你能舉個例子嗎?我不太瞭解Javascript ... – RevConcept
先學習Javascript吧:) – djechlin