1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-02-24 12:40:58 +00:00
bootstrap/examples/assets/js/bootstrap-dropdown.js
2011-08-28 16:36:44 -07:00

22 lines
468 B
JavaScript

(function( $ ){
/* DROPDOWN PLUGIN DEFINITION
* ========================== */
function clearMenus() {
$('a.menu').parent('li').removeClass('open')
}
$('body').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 )