bootstrap-dropdown.js 468 Bytes
Newer Older
Jacob Thornton's avatar
Jacob Thornton committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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 )