0
0
mirror of https://github.com/twbs/bootstrap.git synced 2024-12-01 13:24:25 +01:00
Bootstrap/examples/assets/js/bootstrap-dropdown.js
2011-08-28 16:47:38 -07:00

24 lines
493 B
JavaScript

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