mirror of
https://github.com/twbs/bootstrap.git
synced 2025-09-26 21:39:08 +02:00
add topbar dropdown js
This commit is contained in:
22
examples/assets/js/bootstrap-dropdown.js
vendored
Normal file
22
examples/assets/js/bootstrap-dropdown.js
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
(function( $ ){
|
||||
|
||||
/* DROPDOWN PLUGIN DEFINITION
|
||||
* ========================== */
|
||||
|
||||
function clearMenus() {
|
||||
$('a.menu').parent('li').removeClass('open')
|
||||
}
|
||||
|
||||
$(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 )
|
Reference in New Issue
Block a user