1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-09-26 21:39:08 +02:00

add topbar dropdown js

This commit is contained in:
Jacob Thornton
2011-08-27 21:46:50 -07:00
parent e91353f362
commit ed96f181c8
5 changed files with 132 additions and 128 deletions

View File

@@ -0,0 +1,22 @@
(function( $ ){
/* DROPDOWN PLUGIN DEFINITION
* ========================== */
function clearMenus() {
$('a.menu').parent('li').removeClass('open')
}
$(window).bind("click", clearMenus)
$.fn.dropdown = function ( options ) {
return this.each(function () {
$(this).delegate('a.menu', 'click', function (e) {
clearMenus()
$(this).parent('li').toggleClass('open')
return false
})
})
}
})( jQuery || ender )