0
使用twitter引導框架在下拉式登錄菜單中的下拉菜單中存在問題。登錄框的第二個下拉菜單不起作用。是否可以在下拉菜單中包含分隔按鈕下拉菜單,如下例所示。你可以在下拉菜單中使用拆分按鈕嗎?
在這裏看到這個小提琴。
使用twitter引導框架在下拉式登錄菜單中的下拉菜單中存在問題。登錄框的第二個下拉菜單不起作用。是否可以在下拉菜單中包含分隔按鈕下拉菜單,如下例所示。你可以在下拉菜單中使用拆分按鈕嗎?
在這裏看到這個小提琴。
當你點擊第二個下拉按鈕,jQuery插件「自舉dropdown.js」隱藏所有元素與一流的「開放」。
您需要編輯文件「bootstrap-dropdown.js」(http://twitter.github.com/bootstrap/assets/js/bootstrap-dropdown.js)並重寫函數clearMenus()。
查找下一個代碼在這個文件中:
function clearMenus() {
getParent($(toggle))
.removeClass('open')
}
,取而代之的是:
, toggle: function (e) {
var $this = $(this)
, $parent
, isActive
if ($this.is('.disabled, :disabled')) return
$parent = getParent($this)
isActive = $parent.hasClass('open')
clearMenus() // here
替換線clearMenus()
與clearMenus($this)
:
function clearMenus($this) {
getParent($this)
.removeClass('open')
}
附近查找行clearMenus()。
這裏的jsfiddle例如:http://jsfiddle.net/BMBc3/
謝謝你的信息和修復。如果我改變這一點,我會看到任何不利影響? – Darren
我沒有測試這麼深的代碼:)在它的表面上,沒有。 – doktorgradus