bootstrap-dropdown.js 493 Bytes
Newer Older
Jacob Thornton's avatar
Jacob Thornton committed
1
2
3
4
5
6
7
8
9
(function( $ ){

 /* DROPDOWN PLUGIN DEFINITION
  * ========================== */

  function clearMenus() {
    $('a.menu').parent('li').removeClass('open')
  }

Jacob Thornton's avatar
Jacob Thornton committed
10
  $(function () {
Jacob Thornton's avatar
Jacob Thornton committed
11
    $('body').bind("click", clearMenus)
Jacob Thornton's avatar
Jacob Thornton committed
12
  })
Jacob Thornton's avatar
Jacob Thornton committed
13
14
15
16
17
18
19
20
21
22
23
24

  $.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 )