twitter/bootstrap — Issue #2452: dropdown menu on wordpress 1rst item can't click
Author: kolorslab
Created: 2012-03-07 16:53:39+00:00
State: open

Hi !

i use the nice boostrap menu on a wordpress webtv.

it works correctly for submenus however i can't click on the 1rst menu which is a category like the submenu items.

i think i have to modify the file : jquery.dropdown.js but i have problems to do it...

i want the sub menu to let's appear the submenu on hover BUT i want the first item (menu) to be clickabble too.

i have this code but i don't understand really where to modify i have try several times but it doesn't work.

the code of th .js :
=============

!function( $ ){

/* DROPDOWN PLUGIN DEFINITION
* ========================== */

$.fn.dropdown = function ( selector ) {
return this.each(function () {
$(this).delegate(selector || d, 'click', function (e) {
var li = $(this).parent('li')
, isActive = li.hasClass('open')

clearMenus()
!isActive && li.toggleClass('open')
return false
})
})
}

/* APPLY TO STANDARD DROPDOWN ELEMENTS
* =================================== */

var d = '.dropdown > a'

function clearMenus() {
$(d).parent('li').removeClass('open')
}

$(function () {
$('html').bind("click", clearMenus)
$('body').dropdown( '[data-dropdown] .dropdown > a' )
})

}( window.jQuery || window.ender );

if someone as an idea ?

thanks guy !

Hugo