2
0
mirror of https://github.com/tenrok/bootstrap.git synced 2026-05-15 11:59:39 +03:00
Files
bootstrap/docs/assets/js/bootstrap-dropdown.js
T
2011-09-06 23:20:56 -07:00

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 )