0
0
mirror of https://github.com/twbs/bootstrap.git synced 2024-12-04 16:24:22 +01:00
Bootstrap/examples/assets/js/bootstrap-dropdown.js

24 lines
493 B
JavaScript
Raw Normal View History

2011-08-28 06:46:50 +02:00
(function( $ ){
/* DROPDOWN PLUGIN DEFINITION
* ========================== */
function clearMenus() {
$('a.menu').parent('li').removeClass('open')
}
2011-08-29 01:47:38 +02:00
$(function () {
$(window).bind("click", clearMenus)
})
2011-08-28 06:46:50 +02:00
$.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 )