mirror of
https://github.com/twbs/bootstrap.git
synced 2024-11-30 12:24:19 +01:00
24 lines
493 B
JavaScript
24 lines
493 B
JavaScript
(function( $ ){
|
|
|
|
/* DROPDOWN PLUGIN DEFINITION
|
|
* ========================== */
|
|
|
|
function clearMenus() {
|
|
$('a.menu').parent('li').removeClass('open')
|
|
}
|
|
|
|
$(function () {
|
|
$('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 ) |