2014-12-01 28 views
0

我正在使用基金會下拉,並在其中我有多個事情,我需要進行交互,包括colpick,添加和刪除組件等。任何時候我做任何這些操作,下拉關閉,因爲它應該是一個下拉菜單。有沒有一種很好的方式讓下拉菜單忽略我的點擊,只有當我點擊關閉按鈕才能關閉?保持Zurb基金會下拉打開時,點擊

+0

您正在使用什麼類型的下拉列表中?它看起來像內容下拉列表:http://foundation.zurb.com/docs/components/dropdown.html允許你點擊它的內部而不關閉。 – cjspurgeon 2014-12-01 18:51:15

+0

嗯,我點擊時通過對事件執行stopPropogation來解決了其中兩個問題事情我基本上想要一種方法來阻止所有點擊事件的發生,所以下拉不會即使當我點擊它之外時也是關閉的,然後只有當我點擊關閉按鈕時才關閉它。 – rwwagner90 2014-12-01 18:58:31

回答

1

伸出使用唱段,自動關閉在<ul>標籤=「假」(見自動關閉在documentation

<a class="button" data-dropdown="autoCloseExample" aria-controls="autoCloseExample" aria-expanded="false">Link Dropdown &raquo;</a> 
<ul id="autoCloseExample" class="f-dropdown" data-dropdown-content tabindex="-1" aria-hidden="true" aria-autoclose="false" tabindex="-1"> 
    <li><a href="#">This is a link</a></li> 
    <li><a href="#">This is another</a></li> 
    <li><a href="#">Yet another</a></li> 
</ul>