From fb8987148aeae4b9aa2b4c28fa3ad5346b8c56b1 Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Tue, 6 Sep 2011 23:20:56 -0700 Subject: move javascript from examples into docs --- docs/assets/js/bootstrap-dropdown.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 docs/assets/js/bootstrap-dropdown.js (limited to 'docs/assets/js/bootstrap-dropdown.js') 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 -- cgit v1.2.3