diff options
| author | Jacob Thornton <[email protected]> | 2011-09-06 23:20:56 -0700 |
|---|---|---|
| committer | Jacob Thornton <[email protected]> | 2011-09-06 23:20:56 -0700 |
| commit | fb8987148aeae4b9aa2b4c28fa3ad5346b8c56b1 (patch) | |
| tree | add30766dfc07105e3154cc848c60b7f9171a248 /docs/assets/js/bootstrap-dropdown.js | |
| parent | d0882c580de1fc2d5c52b684671b554bb8941ddf (diff) | |
| download | bootstrap-fb8987148aeae4b9aa2b4c28fa3ad5346b8c56b1.tar.xz bootstrap-fb8987148aeae4b9aa2b4c28fa3ad5346b8c56b1.zip | |
move javascript from examples into docs
Diffstat (limited to 'docs/assets/js/bootstrap-dropdown.js')
| -rw-r--r-- | docs/assets/js/bootstrap-dropdown.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/docs/assets/js/bootstrap-dropdown.js b/docs/assets/js/bootstrap-dropdown.js new file mode 100644 index 000000000..9fbeb44b0 --- /dev/null +++ b/docs/assets/js/bootstrap-dropdown.js @@ -0,0 +1,24 @@ +(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 )
\ No newline at end of file |
